In 2011, Apple had ported Nitro Javascript engine used in desktop version of Safari to mobile Safari browser in iOS 4.3, which loaded JavaScripts two times faster.
The reason Nitro JavaScript offers improved performance over WebKit’s previous JavaScript engine is due to 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. Apple also does not allow third-party runtimes (due to security concerns), which in turn disallows third-party rendering and Javascript engines.
This has meant that third-party apps such as Chrome, Firefox etc and Home screen webclips that use UIWebView control don’t have access to the faster Nitro JavaScript engine. So webpages load much slower in these third-party apps as compared to mobile Safari. Sometimes it takes so much time to load that I end up opening the link again in mobile Safari in frustration.
It looks like iOS 8’s WebKit has addressed the security concerns, as it includes improvements such as increased JavaScript performance via WebKit’s super-fast JIT. According to developer Vicki Murley, the new WkWebView on iOS is running JavaScripts just as quickly as Safari.
A few teasers: API is the same across iOS and OS X, and the new WKWebView on iOS is running JS just as quickly as Safari.
— Vicki Murley (@vickimurley) June 3, 2014
This is great news as it was one of the frustrating aspects of iOS, and certainly affected user experience. It would also mean that Safari won’t have an unfair advantage at least in terms of performance, which is one of the key factors while deciding which browser to use by default.
It is important to note that if you’re using iOS 8 beta, then you may not see the performance improvements right away as apps will have to implement the new WkWebView to take advantage of the JavaScript performance improvements.
Currently, jailbreakers can access Nitro JavaScript engine by installing the Nitrous jailbreak tweak.
[via 9to5Mac]