Performance problem

Brian D. McGrew brian@visionpro.com
Sun Sep 21 23:10:00 GMT 2008


Oops, try gcc -v on the various compilers, not gcc --version...  See below, you can see how differently my v4.1.1 versus v4.3.0 are (disregard 32-bit vs. 64-bit).

Also, I can compile a binary -O2 -g and the two different compilers and get different results.  It's not unheard of.  Again, it begs the question of source code!

-brian

20_ gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)

And

44_ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-cpu=generic --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) 

-----Original Message-----
From: Łukasz Lew [mailto:lukasz.lew@gmail.com] 
Sent: Sunday, September 21, 2008 2:41 PM
To: Brian D. McGrew
Cc: gcc-help@gcc.gnu.org
Subject: Re: Performance problem

Thanks for a fast answer,
I use -O3 -march=native -fomit-frame-pointer -DDEBUG -ffast-math
-frename-registers -ggdb3  -Wall -Wextra -Wswitch-enum
but I have the same effect with only -O3

Versions:
g++-4.2 (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu1)
g++-4.3 (Ubuntu 4.3.2-1ubuntu7) 4.3.2

The original library is here:
http://www.mimuw.edu.pl/~lew/hg/libego/?shortlog
I extracted only the benchmark part:
http://www.mimuw.edu.pl/~lew/libego_benchmark.tgz

I also found strange one-line difference that degrades performance
of g++-4.2 compiled binary to the level of g++-4.3.

I don't get it at all ..
If you have any insights please let me know, it is very important to me.
Lukasz

On Sun, Sep 21, 2008 at 23:24, Brian D. McGrew <brian@visionpro.com> wrote:
> Source code would be a good start???  Optimization flags???  Architecture flags???  How was gcc-4.3 vs. gcc-4.2 built???  (g++ --version will show this).
>
> -brian
>
> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Lukasz Lew
> Sent: Sunday, September 21, 2008 2:20 PM
> To: gcc-help@gcc.gnu.org
> Subject: Performance problem
>
> Hi
>
> I have a program that when compiled with g++-4.3 is 10% slower than with g++-4.2
> I tried to look at the asm output, but its way too different.
> How should I proceed to get my 10% back?
>
> Thanks
> Lukasz
>



More information about the Gcc-help mailing list