Celebrity death match: HTML5 Vs Flash
When Steve Jobs declared at the iPad’s launch that the device would not support Flash because it was a "CPU Hog," one boffin set out to test the truth of the statement, and found it to be subjective at best.
Jan Ozer writes that because of its stubborn refusal to use Flash in any of its products, Apple has instead had to rely on HTML5, code which eliminates the need for a Flash plug-in and allows the browser to decode rich media itself.
Both Apple’s Safari and Google’s Chrome support the H.264 playback needed to watch things like YouTube videos on HTML5 pages, while Chrome, Firefox and Opera support Ogg Theora playback, which also gets the job done. Rather unsurprisingly, Microsoft's backwards browser, IE, doesn’t support either codec, but does thankfully support Flash.
Ozer decided to run an extensive comparison, not only of HTML5 VS Flash, but also of Flash 10.0 VS 10.1 using both a MacBook Pro (3.06 GHz Core 2 Duo, 8 GB RAM, OS 10.6.2) and an HP 8710w mobile workstation (2.2 GHz Core 2 Duo system running 64-bit Windows 7 with 2 GB of RAM). In theory, Flash 10.1 takes advantage of a machine’s GPU to offload work from the CPU and make things run both faster and smoother.
Unsurprisingly, Ozer found that on a Mac, using Safari, HTML5 was the most CPU efficient option of the lot, eating up just 12.39 chomps of the processor, compared to a significantly higher 37.41 chunk with Flash 10.0. Using Chrome for HTML5 on the Mac, however, yielded even poorer results at a whopping 49.89 CPU usage and an even more appalling 50.39 for Flash 10.0. Firefox on the Mac also guzzled a not insignificant 40.25 piece of the CPU pie.
Testing Flash 10.1, Ozer found that Safari did take advantage of the H.264 hardware acceleration inside the OS to a point, bringing down CPU usage five percent to 32.07. The Mac’s CPU, however, saw only minimal change for Flash 10.1 when used inside the Chrome browser, going from 50.39 to 49.79. Firefox saw an increase of five per cent in CPU suckage for Flash 10.1 on a Mac.
On the HP system running Windows, Safari wouldn’t run HTML5, but Ozer did report a huge difference in CPU usage between using Flash 10.0 and Flash 10.1 in Safari on that particular system – 23.22 for 10.0 and just 7.43 for 10.1 – a whopping 68 per cent decrease in CPU stress. Chrome managed to handle HTML5 slightly better on the Windows system too, managing to scrape a still unimpressive 25.66.
Flash on Chrome was a slightly better experience, with 10.0 managing to burn up just 19.55 of the CPU whilst 10.1 saw a 58 per cent improvement at just 10.73. Firefox saw the biggest difference between Flash 10.0 and 10.1, with the former reaching 22 CPU points whilst the latter kept it on the down low with just 6.00, a record.
The proof, therefore, seems to be in the Windows pudding rather than the Apple pie.
With Windows taking advantage of the benefits hardware acceleration has to offer, Flash is given more scope to shine, and would likely easily hold its own against HTML5 on a Mac if the hardware was enabled to let it do so.
So, Steve Jobs’ grunting about CPU hoggage don’t quite hold water apparently. Then again, did anyone really expect his aversion to Adobe’s flash to come down to anything less than politics?