Tuesday, July 29, 2008

Dhrystones for Everybody!

I just benchmarked my CPU using the somewhat well-accepted synthetic integer CPU benchmarking method called Dhrystone. A Dhrystone is essentially just a single loop, a counter, and a time-counting routine. It's simple enough that a novice could program it in a language he's never used before.

Theoretically, the faster your CPU can perform a dhrystone, the faster your overall speed. However, this isn't necessarily so. Dhrystones measure the speed of integer operations, which means if you're going to do more advanced things with your processor, like 3D graphics (unless you're a fan of voxels) and physical modeling/simulation. For vector calculations, you need to do two different versions of the Whetstone test; one for single-precision, and one for double-precision vector calculations.

In my case, the average (mean) result of three iterations of the Dhrystone test gave me 4357780.67 dhrystones/s, which is about 0.2us per dhrystone. One run gave me as much as five and a half million dhrystones per second. For asinine comparison, I get 5004 BogoMIPS.

I used this shell program which was linked from Wikipedia to benchmark my system. To run it, you'll need to run 'sh dry.c' (without the quotes, obviously) in any POSIX-like environment. I used cygwin, since SiS hardware is too evil for my computer to run a real POSIX environment and I'm stuck in Windowsland. Just make sure you install gcc under the devel category when you install it. Go ahead, run it and send your results to me via comment to this post.

No comments: