Saturday, March 7th 2009

Safari and Chrome are JavaScript Speedfreaks

I decided to have a go at comparing JavaScript execution speed in some upcoming browsers. Actually, that’s just almost true. The version of Chrome that I tested was 1.0 which obviously is a final release. There is no newer alpha or beta release from them at the moment. (As far as I can see.)

The tested browsers are (all on Windows XP):

I tested the browsers with two different benchmark suites. Google’s V8 and Apple’s SunSpider.

So, lets get straight to the results:

Graph showing results for pre-release versions of Opera, Firefox, Internet Explorer, Safari and Chrome for the Google V8 JavaScript Benchmark.

As you can see, I have normalized all the results for both tests so that the winner of each test gets exactly 100. This is to make a comparison possible between the two benchmarks.

I ran all benchmarks three times in each browser to get more reliable averages.

Graph showing results for pre-release versions of Opera, Firefox, Internet Explorer, Safari and Chrome for the SunSpider JavaScript Benchmark.

Safari and Chrome are as tied as can be. They both get a total score of 193. Opera and Internet Explorer are both a lot slower than the two winners, with 38 and 24 respectively.

The interesting thing is that Firefox does so well with SunSpider (93), and so poorly with V8 (12). What is the big difference between these benchmarks? Not that I’d understand it if someone explained it to me …

Obviously there’s still room for improvement to Firefox’s JavaScript engine (currently known as TraceMonkey).

2 Responses to this post:

  1. Execvator says:

    You should test with Dromaeo by “Mozilla’s” John Resig. It incorperates both the V8 and SunSpider benchmarks.According to the page above, SunSpider tests Math, Bitops and Looping while V8 tests Strings and Objects. Both tests Functions.About Firefox, you don't get any errors in the error console (Tools -> Error Console Ctrl+Shift+J) when running the tests, do you?

  2. David Naylor says:

    Actually, I tried that, but it was difficult.It kept freezing in both Firefox, Opera and Explorer. (IE8 kept asking if I wanted to run the heavy scripts.) So I gave up before I even tried it in Safari and Chrome.