Huge binaries?
Kevin Ediger
kediger@licor.com
Fri Nov 19 06:56:00 GMT 1999
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
More information about the Libstdc++
mailing list