• Javascript benchmarking, who to believe?

    There is no shortage of Javascript Benchmark tests out there. Yet lately, it’s started to get a bit shaky on which browser is faster than the other, and some results don’t seem to match real life use. The only thing anyone can agree on is that Internet Explorer is the worst. So what do we believe?

    Browsing around I looked at various benchmarking results, some old, some recent to see how the browsers were fairing. Only they don’t seem to agree with each other, and using some in real life, browser that are supposed to be speedy are actually visually slower than the ones that are supposedly slower. None of it makes sense. On my search I found a few speed testing tools I could use myself, yet again, it didn’t add up.

    One test I tried was benchmarking tool posted on Google. In the test apparently bigger is better… My tests came up as follow…

    Safari 3 – 190

    Opera 9.6 – 199

    Firefox 3 – 208

    Chromium – 2297 (Chromium is a port of Google Chrome Beta for Mac)

    Given these results you’d think that Chromium was lightning fast compared to the others. In real use on a Javascript intensive site of mine, Chromium choked as did Firefox 3, however Safari and Opera were blazing fast. So I re-read the site because I was thinking maybe I misread. I didn’t, it still said bigger is better.

    It’s got me thinking why? I studied the tests for about 2 minutes then I spotted a pattern in the ones that seemed to perform better. The test on Google ran 5 tests through 5 different test engine of different script sizes. Generally the browsers varied at speeds in each test, but there was some strange happenings with the browsers that scored highest. They didn’t seem to score so high in the big tests in comparison to the small test scripts. Here are my findings….

    Safari 3 – 121 + 411 = 3.4x better

    Opera 9.6 – 121 + 571 = 4.7x

    Firefox 3 – 193 + 253 = 1.3x

    Chromium – 2561 + 2984 = 1.16x

    What this shows is even though the browsers may be faster at little jobs, once you start using intense Javascript some browsers tend to slow where as the ones that appear quicker in real use are the ones who’s performance increased compared to the initial shorter scripts. My theory is Safari and Opera are actually faster at more intense scripting, compared to Firefox and Chromium which are better at less intense scripts.

    So after all that I think it’s safe to say different browsers perform differently depending on what the Javascript task it’s performing. If it benchmarks better it won’t necessarily mean better performance on your particular script. If all else fails do some tests!

    NOTE: These tests were run on an iMac 2.8GHz Intel Core 2 Duo with 2GB SDRAM running Mac OS X 10.5.5 with various tabs open in each browser. Test result will vary on different systems. Chromium shouldn’t be used as a benchmark for Google Chrome as the port is significantly slower than the real version of Google Chrome.

    Tags:

Leave a comment