I had a chance to check out one of the new Intel iMacs at an Apple store today, and they are unbelievably fast. Apps launch surprisingly quickly, interface elements are nice and responsive, apps running under Rosetta seem faster than they are on my TiBook, and yes, finally, windows resize beautifully in real time.
As a matter of curiosity, before my trip, I whipped up a little Ruby script to informally benchmark just how fast these machines are. The script reads in a file of some 50,000 numbers, quicksorts them three times, and then reports the average sort time. I realize this is a lame benchmark for a vast number of reasons, probably most importantly because it is not multithreaded and therefore cannot make use of both cores in the new iMac. (Actually, even if it used Ruby threads, it still wouldn’t make use of both cores, since they’re implemented by the interpreter, but I digress. I used Ruby because I’m learning it and I think it’s cool.) Lame benchmark are not, the results are pretty impressive. On my 1 GHz G4, the sort takes about 4.63 seconds to complete. The same sort on the 2 GHz Core Duo completes in 0.85 seconds. That’s a performance increase of 445%, using only half the processing power of the iMac. Just unreal. (Interestingly, 0.85 seconds is about how long it takes my machine to perform the sort using the built-in sort method, which is almost certainly implemented in C. Cool.)
I’d have tested it out on some of other machines at the store, but their Terminal applications were all locked inside an encrypted StuffIt file. I guess I lucked out in the iMac. If you’d like to run the test on your machine, though, download this archive and unzip it, then navigate to the directory in Terminal and type:
% chmod +x quicksort.rb
Don’t type the “%”, of course. If you try it, be sure to report your results in the comments.
Update: On my 3 GHz Pentium 4 at work, the script runs in 1.31 seconds, and on a dual 3 GHz Xeon box, the script runs in 1.51 seconds. Again, this is hardly conclusive evidence of anything other than how long it takes a machine to run this particular script, but still… “New iMac faster than dual 3 GHz Xeon” does have a nice ring to it.