This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Using std::string leads to large size of executable
- From: Martin Sebor <sebor at roguewave dot com>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: Sergiy Yakovin <ysv_ at hotmail dot com>, libstdc++ at gcc dot gnu dot org
- Date: Thu, 15 May 2003 18:25:15 -0600
- Subject: Re: Using std::string leads to large size of executable
- Organization: Rogue Wave Software, Inc.
- References: <Law9-OE40paQmeSgpV60000ce32@hotmail.com> <20030515185903.46e99097.bkoz@redhat.com>
Benjamin Kosnik wrote:
...
I have yet to run across smaller binaries than g++ 3.x and libstdc++ on
linux.
I don't mean to rain on your parade but I recently did a comparison
of the sizes of binaries on Linux and found some pretty disturbing
results (when compared to stdio) with all recent C++ libraries. You
may find the numbers interesting. A "Hello, World!" program compiled
on i86 Linux with gcc -Os and statically linked with the dependent
libraries takes up this much space:
gcc 2.95.2/glibc stdio 888 KB (printf)
gcc 2.95.2/libstdc++ iostreams 1,375 KB (classic iostreams)
gcc 3.2.1/libstc++ iostreams 4,092 KB (standard iostreams)
gcc 2.95.2/libstd 3.1 iostreams 1,914 KB (standard iostreams)
gcc 3.2.1/libstd 3.1 iostreams 1,945 KB (standard iostreams)
gcc 2.95.2/stlport 4.5 iostreams 2,281 KB (standard iostreams)
Regards
Martin