This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
oopack performance
- From: Dan Nicolaescu <dann at ics dot uci dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 06 May 2003 06:28:54 -0700
- Subject: oopack performance
Mainline GCC performs well for the 3 of the 4 oopack benchmarks.
The only exception is "Complex".
On a 1.3GHz Athlon:
g++ -O3 oopack.C -o oopack
./oopack Max=100000 Matrix=1000 Complex=100000 Iterator=100000
Seconds Mflops
Test Iterations C OOP C OOP Ratio
---- ---------- ----------- ----------- -----
Max 100000 0.6 0.6 158.7 156.2 1.0
Matrix 1000 0.4 0.4 568.2 568.2 1.0
Complex 100000 0.9 10.0 930.2 79.7 11.7
^^^^
Iterator 100000 0.3 0.3 645.2 625.0 1.0
The performance can be improved dramatically by just adding a
constructor to the "Complex" class:
Complex (const Complex &F) : re(F.re), im(F.im) {}
./oopack-constructor Max=100000 Matrix=1000 Complex=100000 Iterator=100000
Seconds Mflops
Test Iterations C OOP C OOP Ratio
---- ---------- ----------- ----------- -----
[snip]
Complex 100000 0.9 1.5 909.1 522.9 1.7
^^^^
That is a ~7X performance increase.
Any idea why is this happening?
Oopack can be downloaded from:
http://www.ratol.fi/~sfarin/cpp-bench/oopack_v1p8.C