HTML5 support and Javascript perf across different browsers

I am currently putting together a preso on HTML 5 for codecampoz and as part of this evaluated support across different browsers. I also wanted to check on the Javascript performance of a number of different browsers (especially as IE9 came out yesterday) by running various benchmarks. The tables below summarize my findings:

Note that this is a very unscientific study – I only ran the tests once (although some of them repeat themselves anyway) and I had other applications running in the background. Some browsers will also now use hardware acceleration for certain items.

The tests were run on a Dell XPS 16 studio, win7 64 bit, 8gb ram, Intel i7 Q720 at 1.6ghz, ATI Mobility Radeon HD 4670.

Browser HTML5test Sunspider (ms) Kraken (ms) V8v5
IE 8 (8.0.7600.16385) 27 5204.0 119
IE 9 beta (9.0.7930.16406) 96 661.4 61183.0 1328
Firefox (3.6.9) 139 829.4 17924.7 524
Firefox (4.0b6) 204 746.2 11950.6 1008
Chrome (6.0.472.59) 217 588.2 15941.5 6226
Opera (10.62) 159 622.4 13617.3 3916
Safari (5.02 7522.18.5) 207 732.4 18689.6 28

Table 1. scores and various Javascript benchmarks

As the preso is about using HTML5 I wanted to see which areas could be used across the most browsers. I picked a few areas I would want to make use of the most and the results (again based on are below:

Functionality IE 8 IE 9 beta Firefox Firefox 4 Chrome Opera Safari
Doctype trigger strict Y Y Y Y Y Y Y
Canvas N Y Y Y Y Y Y
Video N Partial Partial Partial Partial Partial Partial
Audio N Partial Partial Partial Partial Partial Partial
Forms N N N Partial Partial Partial Partial
Drag and drop N N Y Y Y N Y
Application Cache N N Y Y Y Y Y
Geo location N N Y Y Y Y Y
Cross document Y Y Y Y Y Y Y
Web sockets N N N Y Y N Y
Session storage Y Y Y Y Y Y Y
Local storage Y Y Y Y Y Y Y
SVG in text N Y N Y N N N
Web workers N N Y Y Y Y Y
Web SQL Db N N N N Y Y Y

Table 2. Support of key HTML 5 elements across browsers

Note that Web SQL db has been dropped in favor of indexed db and all vendors so far have used SQLLite to implement the WebSQLDb.

So in summary from my unscientific tests:

  • Chrome provides best html5 support (in terms of score)
  • Chrome is quickest on Sunspider benchmark but Opera is quickest on Kraken (which utilizes Sunspider)
  • IE8 is massively slower on js benchmarks but IE9 js perf is much improved (the Kraken test wouldn’t even run on IE8 and kept giving dialogue about script running slow)
  • You can use some of the storage stuff if your users browsers are fairly up to date
  • Canvas support is good on latest browsers across the board

Links: (bonus points ignored)