This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: Huge binaries?
- To: "libstdc++ at sourceware dot cygnus dot com" <libstdc++ at sourceware dot cygnus dot com>
- Subject: Re: Huge binaries?
- From: Kevin Ediger <kediger at licor dot com>
- Date: Fri, 19 Nov 1999 08:55:12 -0600
- Organization: LI-COR, Inc.
- References: <8625682E.0035B449.00@hooper2.licor.com>
- Reply-To: kediger at licor dot com
Gerald Gutierrez wrote:
> When using gcc 2.95.2 and libstdc++, why is it that sometimes binaries
> can get so HUGE? People must've seen this before. A small program can
> compile to 600K in size, and even after stripping, it's still well
> over 100K.
>
> Templates, perhaps?
P.J. Plauger has an article about Locales in C/C++ Users Journal, Oct 1997. He blames
a lot of the code bloat specifically on the C++ locales as mandated by the standard.
He points out that when compiling "Hello, World" with his first library that
implemented locales, the binary came out at 250,000 bytes. Another library gave a 1.5
Mbyte "Hello, World"! Clearly not acceptable.
Plauger does state that he got hello world down to 20k. I guess the point is that the
C++ standard locales are just plain expensive, even when you don't use them
(unfortunately) and take some work to "optimize" away the bloat. However, if you do
need them, they are VERY nice to have around.
Best Regards,
Kevin Ediger
--
LI-COR, Inc.
Voice: 402.467.3576 ext 3695, Fax: 402.467.0872
mailto:kediger@licor.com
http://www.licor.com