I've run the QUIZ benchmark on several systems to check their relative performance and had quite a surprise.
I'll take Frank's algorithm as reference for simplicity as it spends roughly the same time for each point distribution in 157_benchmark_2.rb but this is true for all of them.
This is on Gentoo Linux, all systems are compiled with gcc 4.1.2
on 32bit : -O3 -march=i686 -fomit-frame-pointer -pipe
on 64bit : -O2 -pipe
Each benchmark as been run at least twice and at least once while monitoring the swap/cpu usage with vmstat and top and once without monitoring to reduce interference. The results where nearly the same.
First 64bit MRI is slower on the same hardware than 32bit :
* Athlon 64 X2 3800+ (2GHz) 64bit : ~25% faster in a 32bit chroot on the same system (~24s instead of ~30s).
* Core2Duo 64bit : ~25% slower than Core2Duo 32bit too (~18s on E6750 (2.66GHz) instead of ~20s on E6300 (1.83GHz), should be 14s assuming perf = k*GHz which results in the "-25%")
That's not unexpected, but I didn't think it would be so large a performance hit.
Now for the true surprise:
The 32bit Core2Duo E6300 is a system with several user-mode-linux based systems which are idling around (low trafic mail, DNS server and test systems). It sits at a constant 0 load and zero swap activity.
The benchmark is 2x faster *in* the virtual machine (with the very same compilation options, the virtual machine is mostly a clone of the host) : 10s instead of 20s ! That's not a system timer problem, I actually watched it spend the 10s and 20s.
I don't know what's going on... Maybe Ruby is making a very specific system call that happens to be faster with user-mode-linux even though the benchmark consists of nearly 99% floating point operations.
The UML kernel is a 2.6.18 with the UML patches, the host is a 2.6.23.9 with the skas3 patch (designed to help the UML performance). The UML sees 512MB, the host has 1GB. As I said, nearly no concurrent system activity, 0 swapping before during and after the benchmark on both the host and the virtual machine.
Anyone seen something remotely like this ?
Lionel