How does your favorite browser's Javascript engine compare with other browsers? I have rewritten an old Javascript test that I ran a year ago. Since then, browsers have been updated, and Safari has come out for Windows. I have tested the Javascript engine speeds of Firefox, Opera, Internet Explorer, and Safari -- how does your favorite browser compare?
The numerical score generated by this test is relative, meaning that results from different browsers are not comparable between different computers. A comparison between two different computers will have more variables than just javascript engine speed.
The results below were generated on my laptop -- Windows XP SP2 Tablet Edition, Intel T2500 2GHz with 1GB of RAM. Your numbers will obviously vary from mine.
I ran this test ten times for each browser, and the average runtime was taken. I have included the actual Javascript test below. I would encourage you to use it to generate your own comparative test, and even examine the Javascript code to examine the test itself.
I have decided to include browser versions that are either in alpha or beta version. You should realize that a browser's beta performance does not necessarily reflect its future performance.
| Test Type | Runtime (ms) |
| Array object | |
| Date object | |
| Error handling | |
| Math object | |
| RegEx object | |
| String object | |
| DOM | |
| Ajax declarations | |
| Total Duration | |
Because all runtimes are relative, I have normalized each browser's total runtime. For example, as seen below, Firefox 3.0.7a's runtime of 4.4X means that it was 4.4 times SLOWER than Opera 9.50a's 1.0 runtime. I have also included the actual millisecond runtimes for comparative purposes.
![]() Firefox 3.0.7a | 4.4X (2722ms) | ![]() IE 7.0 | 1.8X (1077ms) | |
![]() Firefox 3.0.7a (Safe Mode) | 4.0X (2465ms) | ![]() Safari 3.0.3 | 1.3X (790ms) | |
![]() Firefox 2.0.0.6 | 3.7X (2285ms) | ![]() Opera 9.23 | 1.1X (695ms) | |
![]() Firefox 2.0.0.6 (Safe Mode) | 2.3X (1385ms) | ![]() Opera 9.50a | 1.0X (615ms) | |
![]() IE 7.0 (No Add-Ons) | 1.8X (1090ms) | 1.0X = 615.4 ms | ||
Below, I have included a breakdown of each test and its relative runtime by browser. The best performers within each category are highlighted in green, and the worst are highlighted in red.
| Array | Date | Error | Math | RegEx | String | DOM | Ajax | Total | |
| Firefox 3.0.7a | 18.4X | 1X | 2.8X | 2.2X | 1.6X | 6.2X | 4.2X | 4.8X | 4.4X |
| Firefox 3.0.7a (Safe Mode) | 17.5X | 1X | 3.2X | 2.1X | 1.8X | 2.7X | 2.5X | 4.6X | 4X |
| Firefox 2.0.0.6 | 4.1X | 4.7X | 1.5X | 2.6X | 2.4X | 2.1X | 3.9X | 14.5X | 3.7X |
| Firefox 2.0.0.6 (Safe Mode) | 3.4X | 4.5X | 1.4X | 1.9X | 1.9X | 2.8X | 4.6X | 4.6X | 2.3X |
| IE 7.0 (No Add-Ons) | 1X | 3.5X | 2.6X | 2.1X | 2.2X | 1.7X | 3.2X | 3.6X | 1.8X |
| IE 7.0 | 1X | 2.8X | 2.3X | 2.2X | 2.2X | 1.7X | 3.1X | 3.7X | 1.8X |
| Safari 3.0.3 | 1.5X | 3.1X | 1.7X | 1.2X | 1.4X | 1X | 4.8X | 1.2X | 1.3X |
| Opera 9.23 | 1.6X | 4X | 1.2X | 1.1X | 1.2X | 3X | 1.2X | 1.3X | 1.1X |
| Opera 9.50a | 1.8X | 3.9X | 1X | 1X | 1X | 2.3X | 1X | 1X | 1X |
For the impatient person that has scrolled down to the very bottom of the page, I have included a simple graph to display the results of the test. The taller the bar graph, the longer the runtime, and thus the slower the browser's Javascript engine.
I thought that it was interesting that the Safari website claimed about equivalent Javascript speed to Opera 9, and 2-3 times the speed compared to IE 7 and Firefox 2. Safari used a different Javascript test, but their results should be comparable. This test found that IE 7 was much more comparable, and Firefox was much less comparable than Apple's website.
When I originally wrote this Javascript test, it would not run because I overloaded the call stack size in Safari. After doing some research, I realized that Safari has a very, very small call stack, which could be a problem with Javascript-intensive web applications.
A fast Javascript engine should not be the only criteria for selecting a favorite web browser -- there are other factors that should also be considered (plug-ins, security, user interface, etc.).