Performance Numbers for Nitro Javascript Engine in IOS 4.3

TLDR: In summary, the original post is entirely accurate. Javascript running in web apps in Mobile Safari are roughly 2x faster than running in fullscreen mode via saving a web page to the home screen. Additionally, javascript is marginally faster in a custom UIWebView running in fullscreen, but still much slower than Mobile Safari.

There was a post on Hacker News earlier today that demonstrated the new Nitro javascript engine for Mobile Safari only appears to be used when a web app is running in Mobile Safari, but not when that page has been saved as a home screen object and then runs in fullscreen mode.

The post is here: IOS 4.3 Nitro JS engine disabled for full screen apps and uiwebview and the Hacker News post is here: http://news.ycombinator.com/item?id=2317804

I’ve run some numbers using the page from the HN post. The test embeds v0.9.1 of the Sunspider javascript test, which can then be run from the device.

I ran the following tests using a GSM iPhone 4 and iPad v1 32gb w/ 3G, both upgraded to IOS 4.3.

My tests included 3 uninterrupted runs of Sunspider in each of the following situations:

  1. Mobile Safari, native browser
  2. Page saved as home screen icon, full screen
  3. Custom iPhone app using a UIWebView that directly loads the Sunspider test linked to originally

Numbers:

ipad v1 (browser):
page1: 8145.2
page2: 8149.6
page3: 8166.3
avg: 8153.7ms
iPad v1 (fullscreen):
page1: 8383.7
page2: 8374.0
page3: 8201.7
avg: 8319.8ms
iPhone 4 (browser):
page1: 3981.3
page2: 4110.1
page3: 4087.5
avg:4059.33333
iPhone 4 (fullscreen):
page1: 10383.4
page2: 10594.6
page3: 10572.7
avg: 10416.9
iPhone 4 (fullscreen, custom UIWebView app)
page1: 9400.0
page2: 9422.8
page3: 9431.4
avg: 9417.6666

iPad v1 (browser):

  • page1: 3320.3
  • page2: 3248.5
  • page3: 3241.8
  • AVG: 3270.2 ms

iPad v1 (fullscreen):

  • page1: 8383.8
  • page2: 8375.4
  • page3: 8397.2
  • AVG: 8385.4666 ms

iPad (fullscreen, custom UIWebView app)

  • page1: 7689.7
  • page2: 7656.7
  • page3: 7703.9
  • AVG: 7683.4333 ms

iPhone 4 (browser):

  • page1: 3981.3
  • page2: 4110.1
  • page3: 4087.5
  • AVG: 4059.33333 ms

iPhone 4 (fullscreen):

  • page1: 10383.4
  • page2: 10594.6
  • page3: 10572.7
  • AVG: 10416.9 ms

iPhone 4 (fullscreen, custom UIWebView app)

  • page1: 9400.0
  • page2: 9422.8
  • page3: 9431.4
  • AVG: 9417.6666 ms

Finally my original tests were incorrect for the iPad. I had started the upgrade from IOS 4.2 to 4.3 but it had not completed. So, the following numbers are recorded for the iPad v1 using 4.2. Basically, in Mobile Safari javascript is more than 2x as fast javascript run in fullscreen mode.

iPad v1 4.2 (browser):

  • page1: 8145.2
  • page2: 8149.6
  • page3: 8166.3
  • AVG: 8153.7ms

iPad v1 4.2 (fullscreen):

  • page1: 8383.7
  • page2: 8374.0
  • page3: 8201.7
  • AVG: 8319.8ms