Mail Archives: djgpp/2001/09/04/15:30:08
Marco Vienup <Marco AT vienup DOT de> wrote:
>>How much slower? Can you give numbers?
> Hm, I have a simple timeout for(...) construct.
> for(int i=0; i<=500;i++){ one small if(...) }
> If it is the fast code, it will run in a timeout, with
> the slow code the maximum is 100-120.
You could be a bit more precise. The precise nature of that "one
small if()", and the exact set of compiler switches, along with the
compiler version might well be needed to reproduce the behaviour you
observed. It may also be helpful if you run gcc with the compiler
switch -save-temps added, and then look at (or show us) the difference
in the *.s files generated that way, for the different optimization levels.
From a more general point of view, -O3 was indeed known to slow down
code rather than speed them up, for several programs, and several
versions of GCC. That's because the main difference between -O3 and
-O2 used to be the -finline optimization switch, which tends to
deteriorate the performance on architectures tuned for optimal
execution of loops such as the x86 platform.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -