C++ performance

Paolo Carlini pcarlini@unitus.it
Tue Jul 3 16:38:00 GMT 2001


Hi,

without knowing some details of your "open_paths" code I'm afraid that even the
real gcc-gurus (I'm just an user) would not be able to do much...

Anyway, I'm following this kind of discussions since a few months and there are
some recurring themes which perhaps may be helpful for you to know (I do not
enter here in the many improvements already implemented or under study for 3.1)

1\ The g++ inliner bundled with gcc3.0.x is, so to speak, not very smart, so very
often it is not rewarding to compile with -O3 vs -O2 in terms of build time vs
run time trade-off.

2\ It is often suggested to check the effect of the -fno-gcse switch.

So, for the benefit of everyone I think, you may consider testing those 3
combinations of switches (-O2 -fno-gcse, -O3 -fno-gcse, -O2) and then report
about your results.

Cheers,
Paolo.


Burkhard Militzer wrote:

> Hello,
>
> I installed various versions of your GNU g++ compile on my Pentium IV and
> compared the performance:
>
> Test A1 "open_paths" (cd open_path; /bin/time ~/cupid/cupid open) [small mem]
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> (Pentium 4 1.7Ghz)     g++ -O3 (2.95-2 ***  )  8.62 sec.
> (Pentium 4 1.7Ghz)     g++ -O3 (2.95-3)       10.94 sec.
> (Pentium 4 1.7Ghz)     g++ -O3 (3.01)         15.09 sec.
>
> Test A2 "open_paths" (cd open_path; /bin/time ~/cupid/cupid open2) [small mem]
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> (Pentium 4 1.7Ghz)     g++ -O3 (2.95.2 ***)    85.44 sec.
> (Pentium 4 1.7Ghz)     g++ -O3 (2.95.3)       107.79 sec.
> (Pentium 4 1.7Ghz)     g++ -O3 (3.01)         144.87 sec.
>
> (***) executable was compiled on Pentium 3.
>
> The time to execute the 2 benchmarks (the results were all consistent)
> seems to get worse with increasing version number. Is there anything that
> can be done about it?
>
> Furthermore, the compile time of version 3.01 is very long.
>
> Thanks
>
> Burkhard Militzer



More information about the Gcc mailing list