This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Speed-up factor of 1.6 beyond -O3


Hello,

Compiling my C++ code with gcc version 3.2 and

-O3 -ffast-math -mcpu=pentium4 -funroll-loops 

lets it run up to 1.6 faster than just using -O3.

Processor/OS         Compiler/options             Time(sec)
Pentium 1.7Ghz     gnu g++ (3.2) -options above  7.10
Pentium 1.7Ghz     pgCC -O3 -fast -Minline=3/4   8.27
Pentium 1.7Ghz     gnu g++ -O3 (2.95.2)          8.62  
Pentium 1.7Ghz     Intel icpc 5.0 -O3            8.65
Pentium 1.7Ghz     gnu g++ -O3 (2.95.3)         10.94
Pentium 1.7Ghz     gnu g++ -O3 (3.2)            11.30  
Pentium 1.7Ghz     gnu g++ -O3 (3.01)           15.09   

The difference between 2.95.2 and 2.95.3 were caused by compiling with 
2.95.2 for a 386 architecture and from 2.95.3 for an 686 architecture.
Why -mcpu=pentiumpro is a bit slower than -mcpu=pentium4 is not clear. I 
am pretty sure that I have a PentiumPro. Why -funroll-loops is not part of 
-O3 is also not obvious to me.

For comparison:
 
DEC Alpha 1GHz       KCC kcc3.4d -O3               5.2
DEC Alpha 667MHz     KCC kcc3.4g2 -O3              8.4
DEC Alpha 667MHz     g++ -O3 (2.96?)              10.3
DEC Al-Linux 667Mhz  g++ -O3 (2.96?)              14.66
O2K R10000           KCC -O3 +K3 --no_exceptions  18.26
IMB SP2 332MHz       KCC kcc3.4d -O3 +K3          27.56

Burkhard Militzer





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