JavaScript 3-10x Faster On iPhone OS 3.0

iphone_javascript

There has been a reasonable amount of speculation surrounding JavaScript speed improvements in iPhone 3.0. Testing carried out on the iPhone Simulator bundled with the SDK didn’t lead to a conclusive outcome, but benchmarking done by Wayne Pan would seem to suggest that iPhone 3.0 handles JavaScript 3x-10x faster than iPhone 2.1.

Last year the WebKit development team released information about a new JavaScript engine, slated to have a dramatic improvement in performance. Originally dubbed SquirrelFish (now called ‘Nitro’), to date it has not been included in any major release of the iPhone OS. Expectations are that the performance enhancements found in iPhone 3.0 are due to the inclusion of the SquirrelFish engine, leading to faster web site browsing and snappier web app performance.

The new Nitro engine has gradually been improved by the WebKit team over the past year, and is included in the latest Safari 4 Beta. This new engine accounts for the dramatic performance improvement in Safari 4, which Apple states as enhancing both JavaScript and HTML rendering:

Using the new Nitro Engine, for example, Safari executes JavaScript up to 30 times faster than Internet Explorer 7 and more than 3 times faster than Firefox 3 based on performance in leading industry benchmark tests: iBench and SunSpider.

In addition to superior JavaScript performance, Safari offers top-flight HTML performance — the best on any platform — loading pages 3 times faster than Internet Explorer 7 and almost 3 times faster than Firefox 3.

While Nitro is certainly responsible for the improved JavaScript performance, better HTML loading times may be due to other browser enhancements. Hopefully these will also make the move to Mobile Safari, increasing performance and page loading speed. This is even more important on a mobile device, where connection speed is far more limited than on most desktop machines.

Moving this new engine across to Mobile Safari on the iPhone is indeed the next logical step, and the 3.0 release of Apple’s iPhone operating system would seem a reasonable point at which to integrate it. John Gruber created a simple script to test whether a browser is likely to be running the Nitro engine — this tests positive in Safari 4, and he confirmed yesterday that the test is also passed on the iPhone 3.0.

All these pieces of an ongoing puzzle would seem to lead to a fairly strong conclusion that Mobile Safari on iPhone 3.0 will receive a completely new JavaScript engine, significant speed improvements, and better web application performance. I’m thoroughly looking forward to experiencing the same speed boost on my iPhone that Safari 4 brought to my desktop, and can’t wait to try out the new software.

loading

Comments have been disabled for this post