Date: Wed, 20 Mar 2002 13:06:21 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Dear all, I am facing a vague problem (may be trivial !!!): I created a libXXX.a with gcc2.96 and gcc3.00: when I did ls -la : libXXX.a - approx. 6.5MB with gcc2.96 libXXX.a - approx. 12.5MB with gcc3.00 Is it general behaviour ? If its not what is happening and what should I do ?? One more expt is: if I compile with OPTIMIZE= -O2 then the size of Library is approx. 3.5 times larger ??? libXXX.a - approx 38MB with g++3.00 -O2 Could some body explain whats exactly happening...????? BTW, my source code size is approx. .6MB only. What difference it makes in using these Optimize flags etc... will it substantially improves the speed ???? I am using Mandrake Linux 8.2(g++3.00) and Mandrake LInux 8.0 (g++2.96). Shifting to SuSE now....... Thankyou very much for the time and patience. sincerely, Prasad. _________________________________________________________________ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com
On Wed, Mar 20, 2002 at 05:06:21AM -0800, Burra ShivaPrasad wrote:
One more expt is: if I compile with OPTIMIZE= -O2 then the size of Library is approx. 3.5 times larger ???
libXXX.a - approx 38MB with g++3.00 -O2
Could some body explain whats exactly happening...????? BTW, my source code size is approx. .6MB only.
I haven't used any of the 3.x series of compilers, but I do know that one of the things the compiler does with -O2 is inline some functions, e.g. it embeds the instructions for the function where the call would be to make things faster. In general, this would make a program somewhat larger. Why a 3.x library would be larger than a 2.9x library otherwise, I have to leave for someone who knows more. Best Regards, Keith -- LPIC-2, MSCE, N+ you may say I'm a dreamer, but I'm not the only one Got spam? Get SPASTIC http://spastic.sourceforge.net
On Wednesday 20 March 2002 15.13, Keith Winston wrote:
I haven't used any of the 3.x series of compilers, but I do know that one of the things the compiler does with -O2 is inline some functions, e.g.
Actually, that's one of the few things -O2 *doesn't* do :)
From the gcc man page
-O2 Optimize even more. Nearly all supported optimiza tions that do not involve a space-speed tradeoff are performed. Loop unrolling and function inlin ing are not done, for example. As compared to -O, this option increases both compilation time and the performance of the generated code. You'd have to use -finline-functions for that. As far as I know this behaviour is unchanged in gcc 3.0. There, you have -O3 which does do function inlining. As for the sizes, I wonder if everything has been stripped, and what other options were used. And 2.96 is an internal gnu pre-release, with a few redhat hacks to make it work at all. Who knows what that thing does or doesn't do. //Anders
On Wed, Mar 20, 2002 at 03:37:54PM +0100, Anders Johansson wrote:
Actually, that's one of the few things -O2 *doesn't* do :)
Oops. My bad. Best Regards, Keith -- LPIC-2, MSCE, N+ you may say I'm a dreamer, but I'm not the only one Got spam? Get SPASTIC http://spastic.sourceforge.net
I created a libXXX.a with gcc2.96 and gcc3.00:
2.96? SuSE were smart enough to avoid that "release".
libXXX.a - approx. 6.5MB with gcc2.96 libXXX.a - approx. 12.5MB with gcc3.00
Is it general behaviour ? If its not what is happening and what should I do ??
It does appear to be the general behaviour. There were comments on the KDE developers list the other day saying that GCC-3.x is three times slower to compile than 2.95, and produces binaries sometimes twice as big. This is supposedly due to better inlining, but if there is a speedup from the resultant binaries it's hard to notice. If this is progress, I want no part of it! I'm hoping SuSE 8.0 will have both compilers installed by default. -- 2:02pm up 14 days, 23:31, 1 user, load average: 0.08, 0.06, 0.00
On Wed, 20 Mar 2002 14:20:32 +0000, you wrote:
I'm hoping SuSE 8.0 will have both compilers installed by default.
Only 2.95.3 will be installed by default, as it's our standard compiler for the time being. There is a gcc30 package that installs to /opt/experimental and contains a complete gcc 3.0.4 (i.e C, C++, f77, java, objc). Philipp
On Wednesday 20 March 2002 08:06 am, Burra ShivaPrasad wrote:
I am using Mandrake Linux 8.2(g++3.00) and Mandrake LInux 8.0 (g++2.96).
Shifting to SuSE now.......
One of the benefits of SuSE is that in 7.3 they include the very stable and perfectly useful GNU C 2.95. If you're thinking of buying SuSE though you might want to wait for 8.0 rather than getting 7.3. Maybe someone from SuSE can tell us what version of GNU C it comes with. -- Collaboration, n.: A literary partnership based on the false assumption that the other fellow can spell.
On Saturday 23 March 2002 05:16 pm, Philipp Thomas wrote:
On Thu, 21 Mar 2002 16:08:52 -0500, you wrote:
Maybe someone from SuSE can tell us what version of GNU C it comes with.
It's still at 2.95.3.
Good. One thing I like about SuSE is how what needs to be cutting edge is cutting edge, and what shouldn't be at the cutting edge yet isn't. -- "I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." -- Albert Einstein
participants (6)
-
Anders Johansson
-
Burra ShivaPrasad
-
Derek Fountain
-
Joshua Lee
-
Keith Winston
-
Philipp Thomas