Josip Gracin wrote: > Eric Hodel wrote: >> On Sep 21, 2007, at 02:20, Josip Gracin wrote: >>> 3. With ruby 1.8.6 compiled from sources on the machine: >>> >>> Ruby 1.8.6 on i686-linux >>> It took 7.107875 seconds to run. 140689 iterations per >>> second. >>> >>> >>> Obviously, the target instruction set matters quite a lot. I think >>> I'll be compiling my own ruby from now on. :-) >> >> How can you draw that conclusion? You used three different versions >> of ruby. > > You are right, that was one hasty conclusion. > > Here are the real results, indicating how ruby was compiled: > > 1. CFLAGS="-O3 -mcpu=i686 -march=i686 -mtune=i686" ./configure > --target=i686-linux > > Ruby 1.8.5 on i686-linux > It took 6.561333 seconds to run. 152408 iterations per > second. > > > 2. CFLAGS="-O3 -mcpu=i486 -march=i486 -mtune=i486" ./configure > --target=i486-linux > > Ruby 1.8.5 on i486-linux > It took 6.847393 seconds to run. 146040 iterations per > second. > > > 3. CFLAGS="-O3 -mcpu=i686 -march=i686 -mtune=i686" ./configure > --target=i686-linux --enable-pthread > > Ruby 1.8.5 on i686-linux > It took 17.856484 seconds to run. 56002 iterations per > second. > > > Note the "--enable-pthread" in the last measurement. The binary > distributed with Ubuntu is compiled with pthreads. > Oh, and finally, the latest Ruby from svn... 4. CFLAGS="-O3 -mcpu=i686 -march=i686 -mtune=i686" ./configure --enable-pthread Ruby 1.9.0 on i686-linux It took 2.507824 seconds to run. 398752 iterations per second.