HTML5 Apps Get Performance Boost With iOS 8

by: | Jul 24, 2014

One of the little-noticed gems from WWDC (Apple Worldwide Developers Conference) was a change in how iOS 8 interfaces with HTML5: Apple enabled its just-in-time (JIT) compiler for HTML5’s JavaScript when that HTML5 is embedded inside a “hybrid” app. (Hybrid apps written in HTML5 are “wrapped” with a native wrapper, to make it appear like any other app on your iPhone or iPad. This is often done using Adobe’s PhoneGap/Cordova technology.)

Previously, only HTML5 content that ran inside Safari could take advantage of the JIT, meaning that all hybrid apps ran more slowly. This wasn’t mentioned in the keynote, and only a few bloggers picked up on it. But it’s a big deal for an app development company like ArcTouch and for the enterprise. More on that in a minute, but first…

The Back Story

A couple of OS versions ago, Apple introduced a similar JIT for JavaScript that ran inside of Safari. It resulted in a tremendous speed improvement to HTML5 apps running in the browser — but it was not available to native iOS apps with embedded HTML5 content.

If you built an HTML5 web application, it might perform pretty nicely in Safari. But if you tried to embed it into an iOS app — either as part of a hybrid app or using PhoneGap — JavaScript was interpreted the old way, and performance would break down. With our own development, we’ve spent a lot of time optimizing HTML code so that it was functional in iOS, but it never performed up to its full potential.

Although Apple’s non-JIT interpreter of JavaScript is one of the fastest in the industry, Android hybrid apps could actually outperform the same app on iOS, since the JIT was enabled even for these hybrid apps on Android.

Why this iOS8 Update REALLY Matters

This news was not particularly interesting to the majority of people who attend WWDC, which is largely aimed at developers who develop native apps for iOS. And that’s probably why it didn’t make it into Apple’s keynote.

But for those of us making enterprise apps that need to support multiple platforms, this improvement means you can effectively write an app once, in HTML5, and use it for the Web, iOS, Android, or Windows Phone…  and maintain performance parity across all those deployment targets. Now that both web apps and hybrid apps offer similar performance for HTML5 content, there’s good reason to consider using this for cross-platform development, which can lead to time savings.

This efficiency is especially important when you consider the increasing pressure on businesses to support BYOD (bring-your-own-device) policies with employees. Individual workers demand to use the technology/platforms they are most comfortable with. Which means IT departments need to support an array of devices and provide productivity applications that work across all of them.

Office Phone In Trash Can
Related
3 Hidden Gems Your
Enterprise Will Love About iOS 8

Nuance: JavaScript vs. CSS3

The JIT for iOS 8 only affects the performance of JavaScript, and has less bearing on HTML5 apps where CSS is doing the bulk of the heavy lifting using built-in transitions, transformations, and other animations. At ArcTouch, we do a lot of coding using Angular.js, which leverages CSS. The new JIT will still improve the performance of these type of apps, although not as dramatically as an app that does most of the work in Javascript instead of CSS.

Ultimately, these JIT changes make everything faster. And for app developers like us at ArcTouch, which already optimize apps to make them as fast as possible, they’re going to get faster still.