This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using std::string leads to large size of executable


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]