woensdag 25 februari 2009

Safari 4 public beta: benchmark time!

Today Apple released the latest version of their browser: Safari 4. It's only a public beta but with an impressive list of new features including a JavaScript engine that is 4.5 times faster than the previous Safari version, I couldn't resist: benchmark time!

For this benchmark I used the webkit SunSpider benchmark. This benchmark only tests the core JavaScript language, not the DOM or other browser APIs. Looking at the current RIA trend this makes sense: more and more of the application logic (and therefore data structure) is being run inside the browser, so core data structure manipulation will become much more important in the future.

The benchmark runs a couple of tests that consist of crypto and 3d calculations, some bit operations, string and date manipulations, recursion, and object access tests. It returns the time it took to complete each test and the sum of all the tests is the overall score. Here is an example of one of my runs on safari 4 (time in milliseconds). 

For the benchmark I used my Dell latitude D830, running Windows XP. I tested the following 5 browsers:

- The new Safari 4

- Google Chrome 1.0

- IE 7

- IE 6

- Firefox 3.0

- Opera 9.6

After running the same test 5 times in each of the browsers I found the following results (lower bar is better)

In my very non-scientific tests the new Safari 4 is just a fraction faster than Google Chrome and about 2.2 times faster than Firefox and Opera. But it's much much faster than IE6 and IE7: a whopping 13 times on my machine.

Apple itself claims to be 3 times faster than Firefox and even 30 times faster than IE7, using SunSpider and iBench as benchmarks. My findings where not this extreme, but impressive nonetheless.

I guess Google's goal to raise the bar on JavaScript performance was a success. With their dependance on fast JavaScript for all their cloud apps I guess they are the ones that will be most pleased with this new version of Safari.

Oh, and don't forget our ultimate benchmark. Yeah baby!