now | writings | rss | github | twitter | contact

benchmarking cpus for no good reason

posted to writings on may 21st, 2009 with tags nerd, openbsd, and ruby

adding integers 10 million times shouldn't take that long, should it?

$> time ruby -e 'z = 0; 10_000_000.times {|a| z += a }'

openbsd 4.5 amd64 - 2.4ghz intel core 2 duo (thinkpad x200) - ruby 1.8.6 p368

2.750u 0.000s 0:02.75 100.0% 0+0k 0+2io 0pf+0w

linux 2.6.18 x64 - 2ghz intel xeon - ruby 1.8.5

2.925u 0.003s 0:02.92 100.0% 0+0k 0+0io 0pf+0w

openbsd 4.5 amd64 - 1.8ghz amd opteron - ruby 1.8.6 p287

5.130u 0.000s 0:05.29 96.9% 0+0k 0+0io 0pf+0w

openbsd 4.4 amd64 - 1.8ghz amd opteron - ruby 1.8.5

5.210u 0.000s 0:05.31 98.1% 0+0k 45+0io 138pf+0w

openbsd 4.4-current amd64 - 2ghz core 2 duo (vmware) - ruby 1.8.6 p368

3.648u 0.031s 0:05.67 64.7% 0+0k 5+0io 0pf+0w

mac os 10.5.6 - 2ghz intel core 2 duo (imac) - ruby 1.8.6 p114

8.984u 0.074s 0:09.40 96.2% 0+0k 0+1io 0pf+0w

openbsd 4.1 i386 - 2.6ghz intel celeron - ruby 1.8.6 p114

18.164u 0.976s 0:19.25 99.3% 0+0k 42+0io 130pf+0w

openbsd 4.5 i386 - 2.4ghz intel p4 - ruby 1.8.6 p114

22.040u 0.940s 0:29.76 77.2% 0+0k 64+0io 182pf+0w

openbsd 4.5-current i386 - 2ghz core 2 duo (vmware) - ruby 1.8.6 p368

19.540u 13.510s 0:33.21 99.5% 0+0k 0+2io 0pf+0w

openbsd 4.5-current i386 - 1.6ghz intel atom (dell mini) - ruby 1.8.6 p368

54.080u 0.060s 0:54.70 98.9% 0+0k 0+0io 0pf+0w

it's not that surprising that the quicker results are on 64-bit machines, but it seems a bit ridiculous that my thinkpad can do something in 2 seconds that takes my dell mini 54 seconds. two vmware images on my imac, both running openbsd but one in 64-bit mode (amd64) and another in 32-bit mode (i386) are 28 seconds apart.

Comments? Contact me via Twitter or e-mail.