How to boost JavaScript performance of Browser based apps like Chrome

BY Gautam Prabhu

Published 6 Apr 2014

Apple had ported the Nitro Javascript engine to mobile Safari in iOS 4.3 back in 2012, which loads javascripts two times faster. However, Apple did not make Nitro available system-wide in iOS because of security.

The biggest reason for Nitro’s JavaScript performance improvement over WebKit’s previous JavaScript engine is the use of JIT (Just-In-Time) compilation. A JIT requires the ability to mark memory pages in RAM as executable. However, due to security reasons, iOS does not allow pages in memory to be marked as executable. Apple made an exception to the policy only for mobile Safari.

This has meant that third-party apps including browsers like Chrome and Home screen webclips that use UIWebView control don’t have access to the faster Nitro JavaScript engine. So webpages load much slower on these third-party apps as compared to Safari. Sometimes it takes so much time to load that I just open the link in mobile Safari in frustration.

If you’ve jailbroken your iOS device, and frustrated with the slow load times, then there is an easy way to enable Nitro JavaScript engine. All you need to do is install a jailbreak tweak call Nitrous. It is available on Cydia for $0.99, and compatible with iOS 5.x, iOS 6.x and iOS 7.x.

As you can see in the screenshots below, based on the speed tests carried out at Speed-Battle.com, there is a significant performance improvement after installing the Nitrous jailbreak tweak (Higher Number = Better Performance).

nitrous

Speed test: Safari (left), Chrome without Nitrous (middle), Chrome with Nitrous (right)

So when will Apple make Nitro available system-wide in iOS? It is anybody’s guess, but the still in progress WebKit2 framework may be the solution, as it is “designed such that the components that provide web rendering cleanly from their surrounding interface or application shell, creating a situation where, web content (JavaScript, HTML, layout, etc) lives in a separate process from the application UI”.

Until then you can use Nitrous to enable the Nitro JavaScript engine in UIWebView based third-party apps and Home screen webclips. You could also try iWebBoast by the developer of iRealSMS that offers similar functionality, and is available for the same price as Nitrous.

Let me know how it goes in the comments.