How Does Safari 5's JavaScript Performance Stack Up?
Apple has made some strong claims about the performance of Safari 5 in comparison to not just Safari 4, but to all other major browsers. This piqued my curiosity as to the validity of the claim. To test, I used Mozilla's Dromaeo, Webkit's Sunspider and Google's V8 benchmark suite. All tests were done on an otherwise idle iMac 2.8 GHz Intel Core i7 w/ 8GB ram running Mac OS X 10.6.3.
The result? It depends on who you ask. Chrome beat out Safari 5 in 2 out of 3 of the tests. The one test Safari won out on was SunSpider, which was developed by the Webkit team, which seems like it's a fair test to compare Chrome and Safari with. For all of the boasting the Opera guys make about Opera's performance, I found it to be in the middle of the pack. Firefox is clearly the last horse in the race.
For the purpose of what I was interested in, I'll be highlighting only the "total" scores or timings from each benchmark.
SunSpider
I ran the latest version of the SunSpider benchmark. Safari 5 was 1.4 times faster than Safari 4 in Sunspider while it was 1.27 times faster than Opera and only 1.15 times faster than Chrome. Firefox was the real loser in performance, Safari 5 was 2.34 times faster than Firefox 3.6.3.
V8 Benchmark Suite
I would expect that Chrome would shine in Google's own benchmark suite and indeed it did. Chrome was 1.46 times faster than Opera and 1.61 times faster than Safari 5. It was 2.29 times faster than Safari 4. At 11.78 times faster, it outpaced Firefox handily.
Dromaeo
For the Dromaeo benchmark, I used the recommended tests option. This appears to be the most comprehensive of all of the tests, or at least it took the longest of all the benchmarks. I didn't test Safari 4 with Dromaeo, but given that V8 tested Safari 5 as 1.42 times faster than Safari 4 and SunSpider said Safari 5 was 1.4 times faster than Safari 4, I don't feel too bad about omitting it. Okay I feel a little bad and wish I had remembered about Dromaeo before upgrading to Safari 5.
Dromaeo had Chrome winning out over Opera at 2.22 times faster. In addition Chrome was 6.67 times faster than Firefox and 2.27 times faster than Safari 5.
Benchmark Data
These numbers represent the overall performance metric for each test.
- Chrome 5.0.375.70
- Dromaeo: 903.35 runs/s
- SunSpider: 265.4ms +/- 6.6%
- V8 Benchmark Suite: 6,966
- Firefox 3.6.3
- Dromaeo: 135.42 runs/s
- SunSpider: 678.2ms +/- 1.3%
- V8 Benchmark Suite: 591
- Opera 10.53
- Dromaeo: 405.27 run/s
- SunSpider: 290.4ms +/- 2.5%
- V8 Benchmark Suite: 4,755
- Safari 4.0.5
- SunSpider: 319.6ms +/- 3.2%
- V8 Benchmark Suite: 3,041
- Safari 5.0
- Dromaeo: 397.35 runs/s
- SunSpider: 228.8ms +/- 2.4%
- V8 Benchmark Suite: 4,325
Benchmark Links
Dromaeo Results
Sunspider Results