Monday, June 8, 2009

Chrome still king?

Back in January I compared the Javascript performance of both "nightly" and "released" versions of the major web browsers. At that time, Chrome seemed to be the winner. That's why I was surprised when Phil Schiller said this during his WWDC keynote today:
It [Safari 4] is the fastest browser on any platform. And that extends to JavaScript.
A helpful Slashdot poster followed up with this link, which gives more detail regarding Schiller's claim:
Testing conducted by Apple in May 2009 on a 2.8GHz Intel Core 2 Duo-based iMac 24-inch system using Windows Vista SP2 and configured with 2GB of RAM and an ATI Radeon HD 2600 PRO with 256MB of VRAM. HTML and JavaScript benchmarks based on VeriTest’s iBench Version 5.0 using default settings and the SunSpider Performance test. Testing conducted with the following versions of the browsers: Safari 4.0, Chrome, Firefox 3.5 Beta 4, Firefox 3.0.10, Opera 9.6.4, and Internet Explorer 8.0.6001.18702. Performance will vary based on system configuration, network connection, and other factors.
Emphasis mine. So, let's see how the lastest Chrome stacks up vs. Safari 4 on my much more modest system: 2.4GHz Pentium 4 "Northwood", Windows XP SP3 with 1GB RAM and an ATI Radeon 9600 Pro.

Sunspider: 1427
Dromaeo: 193
V8 v3: 1368
Peacekeeper: 1174

Safari 4.0 (530.17)
Sunspider: 1836
Dromaeo: 116
V8 v3: 1031
Peacekeeper: 1567

Unfortunately I'm not able to test iBench 5.0 on my system since it requires somewhat more extensive setup. Also note that on Sunspider "lower is better" while on the others "higher is better".

So what can we take away from this?
  1. Sunspider performance between Chrome and Safari really depends on the underlying hardware. Apple's benchmarks show Safari outperforming Chrome by approximately 30%. On my hardware the situation is exactly reversed.
  2. Chrome still thrashes Safari on Dromaeo and V8, while Futuremark's test clearly favors Safari.
  3. When we drill down to individual benchmarks, each browser scores some "big wins" over its competition:
  4. Chrome excels at "3d", "access", "math" and "regexp" from Sunspider, "base64", "code evaluation", "regexp" and "3d cube" from Dromaeo, "complex graphics" from Peacekeeper, and "DeltaBlue", "Crypto", "Raytrace", "EarleyBoyer" and "Splay" from V8.
  5. Safari excels at "Richards" from V8, and "Social Networking", "Data", and "DOM Operations" from Peacekeeper.
To sum up, in my opinion Chrome still offers the best Javascript performance available, and that is especially true on older hardware. Thus it seems somewhat disingenuous for Schiller and Apple to tout Safari 4.0 as having the fastest Javascript engine on the planet when when the truth is a mixed bag at best.

It's also worth mentioning that, according to wikipedia, the version of iBench used by Apple for their most recent comparison was developed in 2003. That's six years ago, for those of you keeping score at home. I have serious misgivings about the extent to which a Javascript benchmark developed that long ago will accurately reflect a browser's performance on "modern" Javascript tasks.