Handling JavaScript Code, Microsoft Internet Explorer 8 vs Mozilla Firefox 3.0
Both of these browsers have had beta releases out for a while now and with a number of changes coming it would be good to see how they stack up side by side. One of the areas I have always been interested in as far as performance goes is JavaScript. Nowadays applications are making extensive use of JavaScript to cut down to the trip back to the server amongst other things.
Knowing some metrics of how IE8 and Firefox handle the code would be really beneficial. Ryan Lanciaux has done just this. He made use of the Dromaeo: Javascript Performance Testing Suite which was just released yesterday to run a number of tests.
I ran the tests in groups because there were certain ones that were not finishing under IE8. To be quite honest, I’m not 100% sure if this is an Internet Explorer issue, or an issue with the tests. Both are a work in progress so I would rather not make assumptions at this point.
And the results:
| Test Name | Firefox 3.0 | Internet Explorer 8 |
|---|---|---|
| Fannkuch 122 | 802.80 ms | 1032.20 ms |
| Base 64 Encoding And Decoding | 2942.00 ms | DNF |
| DNA Sequence Alignment 116 | 420.00 ms | DNF |
| N-Body Rotation And Gravity 122 | 270 ms | 529.40 ms |
| Prime Number Computation (2) 122 | 308.80 ms | 518.20 ms |
| Recursive Number Calculation 122 | 184.40 ms | 417.80 ms |
| Traversing Binary Trees 122 | 156.80 ms | 422.20 ms |
DNF = Did not finish
You can see straight away that Firefox seems to be the performing browser in the JavaScript area especially around some of the more complex JavaScript operations.
Thanks to Ryan for running these test. It provides a good view of how these browsers are shaping up to cope with JavaScript. Ryan’s full post can be found here: http://frickinsweet.com/ryanlanciaux.com/…
For more metrics you can view a comparison on the Dromaeo site. The metrics here include Safari 3.1 as well. You can find this here: http://dromaeo.com/?id=250,246,251,256.


Pure number computation problems in Javascript are far less interesting than many other metrics: features supported, for one (lack of SVG support of any kind in IE being a serious problem), but also general DOM manipulation, XML parsing, etc. etc. The amount of raw computations that a typical webapp needs to perform is pretty low compared to the amount of DOM manipulation it needs to do.
Why does the Firefox browser run Scripts faster than IE? Also how does the handling of scripts differ in these two browsers???