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
- Subject: Re: Huge binaries?
- From: Nicolai Josuttis <nicolai dot josuttis at braunschweig dot netsurf dot de>
- Date: Sun, 21 Nov 1999 20:46:00 +0100
- Organization: Solutions in Time
- References: <8625682E.0035B449.00@hooper2.licor.com> <383564D0.93B280EC@licor.com>
- Reply-To: solutions at josuttis dot de
Kevin Ediger wrote:
>
> 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.
>
Just not to be confused.
The standard does NOT say HOW compilers and libraries are implemented.
It only has requirements. There are ways to implement all i18n stuff
in a way that the overhead of i18n is not part of the code when
if is not needed.
The C++ Standardization Committee is currently working on documents
that target this issue (e.g. to use C++ in embedded systems).
Best
Nicolai Josuttis
> 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
--
Nicolai M. Josuttis http://www.josuttis.de/
Solutions in Time mailto:solutions@josuttis.de