JavaScript Performance Rundown, 2012

Before giving a conference talk on Node.js earlier this summer, I ran some limited JavaScript benchmark tests, since I couldn't find any recent (this year) data posted. Inspired by John Resig's performance analysis a few years ago, I decided to expand on that study by updating browsers and adding more benchmark suites to get a more comprehensive view of performance. I'll be presenting results for the 5 top desktop browsers:

  • Google Chrome v20.0.1132.47 (V8 Engine)
  • Microsoft Internet Explorer v9.0.8112.16421 (Chakra Engine)
  • Firefox v14.0.1 (SpiderMonkey Engine)
  • Opera v12.00 (Carakan Engine)
  • Safari v5.1.7 (SquirrelFish Engine)

Browser/engine versions are up to date at time of writing. Values reported are the mean of 10 consecutive runs with each browser. Tests were performed on a Intel Core i7 Macbook Pro with 8GB RAM, running Windows 7 Ultimate SP1.

First, let's check out the SunSpider 0.9.1 JavaScript benchmark test:

Interestingly, the latest version of Microsoft's Chakra engine slightly edged out Chrome and its V8 engine in my test. Fear not, the result is not statistically significant. However, I do have to give credit to MS. For the capabilities tested by SunSpider, Chakra currently performs as well as V8. The remaining browsers went Opera, Firefox, Safari, from best to worst. These differences, though they appear small on the graph, were statistically significant (p < 0.01).

Moving on, I went to the V8 JavaScript Benchmark Suite. This is the suite used by Google internally to optimize and test the V8 engine, so expect V8 to perform well on this. Results:

Chrome/V8 takes a solid lead here, with Firefox/SpiderMonkey a distant second, and everyone else trailing.

Finally, Mozilla's Kraken benchmark suite:

Again, Chrome/V8 and Firefox/SpiderMonkey in a league of their own, with Chrome slightly ahead. Results here were statistically significant (p < 0.01) as well.

So, for now, the V8 engine remains the champ (nothing to worry about here, Node.js users), though its nice to see an unexpected second wind from contenders like IE9 in some benchmarks. If I get time, I'll try to add a few more benchmark suites to round this out, though I did find some reported results for Chrome vs Firefox on Peacekeeper that maintain V8's superiority.