Reputation: 822
I am working with a web app built for webkit browsers that is quite javascript-heavy. The app runs rather smooth in the safari browser and the initial loading is about 1,5-2 sec (iPhone 4s iOS 6) on my 3g net. However, when I launch the app from my homescreen, the splashscreen will stay for 5-6 seconds, sometimes even longer (Have gotten reports it can stay for around 10 seconds).
I am wondering how the difference can be so big? What can be done to reduce this loading?
Any help is appreciated.
Upvotes: 4
Views: 1570
Reputation: 483
Web apps launched from the homescreen are slower than those launched from inside Safari, due to the home screen ones not taking advantage of Safari's Nitro Javascript engine.
Source: http://thenextweb.com/apple/2011/03/17/apple-admits-to-slower-performance-in-ios-web-apps/
Yes, the article is a bit dated, but I cannot find any information stating that this is no longer the case.
Upvotes: 0
Reputation: 5414
If you are using a UIWebView where you load your WebApp, you are using a version of WebKit that does not support JIT optimizations for JS (source)
I'll break the app in smaller pieces and try to show something to the user ASAP, then continue loading your JS in the background. I know this is not good, but if your problem is a heavy JS App, you are stuck with non-JIT WebKit engine (AKA UIWebView)
Have a look at WWDC 2012 Session 601: Optimizing Web Content in UIWebViews and Websites on iOS (you need to be a registered iOS developer), and hear this episode of Cocoanetics podcast
Would love to know some optimizations, though.
Upvotes: 1