X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Tue, 5 Mar 2002 14:20:22 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Traveler cc: djgpp AT delorie DOT com Subject: Re: "Hello World !" growed from 361 KB to 730 KB ! What's going on ? In-Reply-To: <001001c1c433$08142a40$010000c0@k2c8i1> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 5 Mar 2002, Traveler wrote: > -g 777 KB > -gstabs+ 855 KB > -ggdb3 914 KB > > > What happens if you run `strip' on the program? > > Running "strip --strip-unneeded hello.exe" helps. That monstrous "hello.exe" > drops from 730 KB (with optimization's and without debugging info) to 234 > KB. 230KB is about right for GCC 3.x. The rest (the stuff stripped by `strip') is debug and symbolic info that is never loaded into memory when the program runs, it is only there for when you need to debug the program, or symify the crash traceback. > However, it's still quite large for the simplest possible C++ program... Welcome to C++, a monstrously large language, where even to say hello you need a lot of baggage. If that bothers you (I don't think it should), don't use C++. > I can understand that there maybe is some extra code to prepare DJGPP > generated programs to run in 32-bit mode in an environment that has allways > been 16-bit (DOS). This has nothing to do with 32-bit vs 16-bit programs. It has everything to do with the bloat in C++ classes used to print formatted messages. The fact that C programs, which also run in 32-bit protected mode, are so much smaller is the proof of this simple fact.