Competition in the browser space breeds better performance. And with Google getting into the browser game with Chrome, all of the developers have stepped up their game. With that in mind, we decided to survey the current browser landscape on Mac OS X to see which offers the best JavaScript performance. Given that Chrome for Mac OS X has yet to hit 1.0, we decided to go with the latest nightly builds for both it and Safari (WebKit), as well as the latest Mozilla alpha (3.6a1), Camino beta, and Opera beta.

Late last week, CNET declared the latest developer preview release of Chrome 4.0 for Mac OS X was the "fastest OS X browser," citing SunSpider benchmark performance that was 34 percent better than Safari 4.0.3. The "fastest browser" competition is always evolving: last summer there was a heated race for the title of Mac OS X browser speed champ. Our own testing reveals that the current alpha builds of Chrome edge Safari 4.0.3 slightly, but WebKit nightly builds are still out ahead of the pack.

First, it's important to note a couple of things. Safari, Apple's Web browser, is built using the open source WebKit HTML and CSS rendering engine and the Nitro (n?e SquirrelFish Extreme) JavaScript engine. The WebKit team releases nightly test builds of WebKit + Nitro called, well, WebKit. Google's Chrome browser also uses WebKit for rendering, but uses its own V8 JavaScript engine. The open source project behind Chrome is called Chromium, which also releases regular alpha test builds. CNET only compared one of these alpha builds of Chromium to the shipping version of Safari. We thought a comparison with a Safari alpha—essentially, a WebKit nightly—would be more fair. And since Mozilla is shooting for major JavaScript improvements for Firefox as well, we compared the latest shipping and alpha versions of Firefox, which use the Gecko rendering engine and TraceMonkey JavaScript engine.

Here's the test bed: a 2.0GHz Core Duo (32-bit) MacBook with 2GB RAM and Mac OS X 10.5.8. All the latest versions of the most common Mac OS X browsers were installed, including Safari 4.0.3, WebKit nightly build 47388, FireFox 3.5.2, Firefox 3.6a1, Chromium build 23572, and for good measure we included Camino 2.0b3 and Opera 10b3. The system was rebooted, each browser was loaded separately, and run through the SunSpider 0.9 JavaScript benchmark three times in succession. The run times were averaged, though we noted very small variations in execution time.

From the results we can see a couple things. First, Firefox 3.6 will definitely have speed gains due to TraceMonkey improvements—our test showed a 12 percent gain on Mac OS X. Second, these early builds of Chrome, and its V8 JavaScript engine, do in fact edge out Safari 4 ever so slightly. Our testing revealed a 4 percent advantage, far from the 34 percent that CNET claimed. And last, nightly builds of WebKit are faster still—19 percent faster than Safari 4, and 15 percent faster than the latest Chrome alpha. These WebKit results echo those measured by readers who posted SunSpider results in our forums.

Honestly, we'd call the 4 percent difference between shipping Safari and alpha Chrome imperceptible, and we wonder if the more significant advantages of WebKit nightly builds would be noticeable either—we're talking about a tenth of a second difference on a rather lengthy benchmark. In real-world use, we don't think users would notice except for the most demanding JavaScript-heavy sites.

Better still, Safari 4 running on Snow Leopard promises a 50 percent speed boost when running in 64-bit mode (we'll need a new MacBook to test that next month). And, Chrome for Mac OS X is still a long way from being ready for daily use—the versions currently available aren't even close to beta status, much less a stable release.

We've noted in the past that browser performance includes a number of factors, such as network latency and HTML and CSS rendering, and there are even tricks that can influence the subjective impression of speed. But, if we're going to compare alphas to alphas (pun intended), then WebKit is still the reigning JavaScript speed champion.