Every so often, it’s nice to take a look at the state of Javascript performance among the various browsers. Though misleading, it’s become something of a truism that “browser performance” is just a nice euphemism for “Javascript performance,” since any website doing anything interesting is basically leveraging Javascript to do it.

What’s come up since the last time I did any sort of Javascript performance comparison? Well, Google Chrome and its JS engine (“V8”), for one. Also, something of a new era in Javascript handling that attempts to optimize how browsers handle it by converting it to bytecode (or, in the case of JavaScriptCore/Squirrelfish Extreme/Nitro, directly to native machine code). In addition, there’s been some new benchmarks arrive on the scene, which allows us to tease out bias from any particular one.

It’s amazing, really, to compare these numbers against the linked benchmark from a mere 1.5 years ago1. Opera went from being the top of the heap with 9.5 to being a lazy 3rd or 4th place. And Chrome, of course, decimated the competition (so far). Read on for the testing methodology and the results.

The tests

I chose four different benchmarks, three of which are entirely Javascript and one of which is mostly Javascript.

  1. Dromaeo is a large, comprehensive benchmark that optionally incorporates some of the other benchmarks we’re looking at today. It was created by the Mozilla Corporation. It offers several test suites, but the one used here was the Dromaeo subset of tests
  2. SunSpider is a benchmark created by the folks behind WebKit. It quickly became and remains one of the most popular and venerated Javascript benchmarks available.
  3. V8 Benchmark is a benchmark application designed by Google to test its V8 Javascript engine. It’s actually a very short and simple benchmark that fantastically favors Google’s browser (and Safari).
  4. Peacekeeper is a new browser benchmark by FutureMark. It’s supposed to test not just Javascript performance, but some rendering performance as well. As you will notice below, the numbers seem a little funny, as it appears to favor Safari (WebKit + Nitro) by a significant margin

The Hardware

All tests were run in Safe Mode (where applicable; meaning that no additional plugins or widgets were loaded) on the following hardware:

  • Intel Core2 Quad @ 2.4GHz
  • 4GB RAM
  • Windows 7 build 7229, x64 Ultimate Edition

The Data

What follows is the raw data table. Jump down for the summary.

Javascript Benchmark Results
Browser Dromaeo
(higher is better)
SunSpider
(lower is better)
V8
(higher is better)
Peacekeeper
(higher is better)
Firefox 3.0.11 43.21 runs/s 3106.0 ms 240 1207
Firefox 3.5rc2 51.03 2652.8 283 1785
IE 8.0.7229.0 * 5176.0 96.5 829
Chrome 2.0.178.0 303.92 829.6 3214 2900
Chrome 3.0.189.0 303.14 793.6 3290 2968
Opera 9.64 29.55 3859.4 218 1406
Opera 10.00b1 71.23 3177.2 244 2019
Safari 4.0 (530.17) 221.73 801.2 2258 3238
Arora 0.7.1 88.85 2209.4 595 2344

The Conclusion

So what does this data tell us?

For starters, it means that the much-vaunted but long-developed Tracemonkey javascript engine in Firefox 3.5 is already a distant third-place player, if not fourth-place. Chrome’s V8 engine outperforms it by no less than a factor of 2 on just about every test. In fact, Chrome 3 on Windows 7 is the fastest browser available, period. Now, Chrome is a very simplistic browser (not even a print preview) and it remains to be seen if its competitive edge in terms of rendering and javascript speed will hold true when it’s got other things to worry about (i.e. plugins).

Safari 4 is a combination of the WebKit rendering engine (like Chrome) and JavaScriptCore, which is the umbrella project name for WebKit javascript engine. While the SquirrelFish engine in Safari 3.1 was fast (doing the JIT bytecode compiling that Firefox 3.5 is doing now…), the new SquirrelFish Extreme engine actually compiles to native machine code. It pulls respectable performance across all tests, usually ranking just behind Chrome…. with the notable exception of the Peacekeeper benchmark, where it takes the lead score. Unfortunately for Safari, its greatest accomplish with version 4 is only managing to not look completely horrible on other platforms, so needless to say it isn’t going to be a contender for the Win32 crown anytime soon2.

How far Opera has fallen from grace. Whereas a couple of years ago it sported the fastest rendering, some of the greatest features, and a great javascript stack, it was quickly eclipsed by the flurry of development happening in other browsers recently. The beta of version 10.00 improves javascript performance significantly, although Opera’s own efforts toward bytecode-based javascript handling aren’t scheduled to land until well after 10.00.

Internet Explorer is, well, still Internet Explorer. While version 8 is a remarkable improvement over version 7, just as 7 was a spectacular improvement over 6, it is still the last shriveled pickle at the bottom of the jar, limping by in each and every benchmark. Microsoft, in their latest FUD to paint IE8 as a wunder-browser, correctly point out that javascript speed isn’t everything, but both benchmark and simple user testing are enough to point out that Microsoft’s browser team is working hard just to stay in the race; they’re not gaining ground at all.

  1. For instance, the Sunspider time for Firefox 2.0 → 3.0 → 3.5 looks something like 14032.0 → 3106 → 2652.8[]
  2. In addition, I’m rather sick of the Safari Installer putting on the Apple Software Update application on my computer even when I explicitly tell it not to.[]
§3846 · June 21, 2009 · Tags: , , , ·

Leave a Reply