From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David B. Rees" To: Sam Lantinga Cc: egcs@egcs.cygnus.com Subject: RE: Large code size? Date: Wed, 24 Mar 1999 13:29:00 -0000 Message-id: In-reply-to: < E10PrbT-0003Og-00@roboto.devolution.com > References: X-SW-Source: 1999-03/msg00771.html On 24-Mar-99 Sam Lantinga wrote: > I'm comparing code size of an application compiled with VC++ and with egcs, > 1.1.1 and the VC++ binary is smaller than the egcs binary by an almost exact > factor of two. The code being compared is self-contained, i.e. it calls no > library routines internally, and is pretty hairy C++ template code. > > The egcs version (compiled with egcs 1.1.1, -O2 -funroll-loops): > -rwxrwxr-x 1 hercules devel 1534443 Mar 25 1999 robotcom.so > > The VC++ version (compiled with VC++ 5.0, /G5 /Ox /Ot /Og /Oi /Op /Ob2) > -r-xr-xr-x 1 hercules devel 654336 Mar 14 10:26 robotcom.dll > > Any ideas why this might be? The same ratio is true for the main > application, which is 13 MB on Linux, and 6 MB on Windows. 7 MB > of difference makes a significant impact on performance, and our > application compares poorly to the Windows version. We'd like it > to compare favorably. :) > > Your thoughts, O Gurus? :) Did you try running strip on the library? Also, compiling with the flag -Os should optimize the code for size, instead of speed. -Dave From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David B. Rees" To: Sam Lantinga Cc: egcs@egcs.cygnus.com Subject: RE: Large code size? Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: References: X-SW-Source: 1999-03n/msg00776.html Message-ID: <19990331234600.vwvS7Hd-iI-S23WmQCdnwKrwiXiK6X-65JDRNFwvacY@z> On 24-Mar-99 Sam Lantinga wrote: > I'm comparing code size of an application compiled with VC++ and with egcs, > 1.1.1 and the VC++ binary is smaller than the egcs binary by an almost exact > factor of two. The code being compared is self-contained, i.e. it calls no > library routines internally, and is pretty hairy C++ template code. > > The egcs version (compiled with egcs 1.1.1, -O2 -funroll-loops): > -rwxrwxr-x 1 hercules devel 1534443 Mar 25 1999 robotcom.so > > The VC++ version (compiled with VC++ 5.0, /G5 /Ox /Ot /Og /Oi /Op /Ob2) > -r-xr-xr-x 1 hercules devel 654336 Mar 14 10:26 robotcom.dll > > Any ideas why this might be? The same ratio is true for the main > application, which is 13 MB on Linux, and 6 MB on Windows. 7 MB > of difference makes a significant impact on performance, and our > application compares poorly to the Windows version. We'd like it > to compare favorably. :) > > Your thoughts, O Gurus? :) Did you try running strip on the library? Also, compiling with the flag -Os should optimize the code for size, instead of speed. -Dave