On Friday, January 4, 2002, at 08:17 , Morten Brix Pedersen wrote:
mbp:~$ g++ benchmark.cpp ; ls -l a.out ; time a.out ; g++-3.0 benchmark.cpp
; ls -l a.out ; time a.out
Well, first, take . out of your path! I get:
-rwxr-xr-x 1 anthony anthony 42840 Jan 5 23:46 a.out
real 0m7.870s user 0m7.210s sys 0m0.490s -rwxr-xr-x 1 anthony anthony 37976 Jan 5 23:47 a.out
real 0m13.835s user 0m13.240s sys 0m0.420s
Ouch! Turning on the optimizer does help some, though:
[EMAIL PROTECTED]:morten$ g++ -O3 -march=i686 benchmark.cpp ; ls -l a.out ; time ./a.out ; g++-3.0 -O3 -march=i686 benchmark.cpp; ls -l a.out; time ./a.out
-rwxr-xr-x 1 anthony anthony 19173 Jan 5 23:50 a.out
real 0m3.146s user 0m2.640s sys 0m0.470s -rwxr-xr-x 1 anthony anthony 19109 Jan 5 23:51 a.out
real 0m4.617s user 0m4.130s sys 0m0.410s [EMAIL PROTECTED]:morten$
Now only 1/3 slower. Still not good.