problem of the application execution speed - webview

We've created an webview style hybrid app, using framework based on PHP
Compared to Android, it takes twice as much time to load the app on the iphone
We've packaged the app using wk webview which based on Safari.
Is there any issue that we can check in order to solve such slow running problem on iphone?
Best regards

Related

Forge viewer crashes after loading some large models

I have been trying to load the model over 200MB on the ios app, but the viewer crashes after loading a few seconds. In the web inspecter, it returns many 404 errors. This error only happens on the ios app and not happens on the android app.
In my mind, I think it is related to the memory limit. I check the document of viewer v7 Allocate Memory for Large Models and Update memory limit but with no fortunate. How could I load the large model on ios app with forge viewer?
Ok based on my colleague's experience, Ionic suffers from web performance problems on mobile, such as 'animation jank', Navigation bugs, keyboard popup bugs with Form input and memory bloat, which could be the main reason why the Viewer is running out of memory.
I will suggest maybe trying React Native. These apps are written in javascript, where the JSC/V8 engine creates & manipulates Native UI components for both iPhone and Android platforms. This gives your app speed and the buttery smooth animation, of a typical native app written in Xcode/Swift and Android Studio/Java. Hence, React Native app's don't suffer the problems that Cordova/Ionic do.
Here is a blog post to help you develop the app.
https://forge.autodesk.com/blog/forge-react-native-au-talk

ffmpeg.js running extremely slow in iOS cordova (but fine in iOS safari?)

I'm trying to create a phonegap app that converts videos into maybe 30 or so jpeg frames..
This page converts a bigbuckbunny video into 30 frames > https://www.pewify.com/test/ (taken from https://bgrins.github.io/videoconverter.js/demo/)
It runs fine on an iPhone x running iOS 12 in mobile safari, it takes about 12-15 seconds to complete, but the same code packaged into a iOS cordova app running on the same phone will take almost 160 seconds to complete (both end results the same, but almost 10x as long), it works fine for android browsers or an android cordova app though
I'm using cordova android 7.0 and cordova ios 4.5.4 (phonegap cli-8.0.0) for the app
I've tried removing all unneeded plugins with just the bare minimum code but to no effect, it still runs just as slow
From what i understand phonegap is just using a webview similar to safari to render the app but in this case it works but much slower, on top of that the phone starts to get heated up (presumably doing some intensive CPU?)
Did read something about using WKWebview being faster in cordova instead but that messes up the app with lots of CORS and 'operation insecure" errors so have decided not to implement that for now (unless that is the solution?)
Hopefully someone can point me in the right direction as i'm not exactly sure what is the issue here as it works somewhat flawlessly in android (both chrome and phonegap) but only in iOS safari and not the phonegap app
Ok solved it, it was indeed WKWebview and it executed normally. I read somewhere that the webview in cordova and the webview in mobile safari is different hence the difference in speed (nitro js engine?)
For anyone interested, I used "cordova-plugin-wkwebview-file-xhr" to enable WKWebview and certain fixes to bypass CORS issues,ran the same code on it (had to use an inline blob when creating the worker though to bypass , taken from here Web workers without a separate Javascript file?)
Video conversion now runs as expected (12-ish seconds), hopefully this helps someone who might be facing slow execution of code on iOS phonegap..

Why does wkwebview run slower in cordova compare to mobile safari?

I've built an app using famo.us which runs very nicely in the native ios 8 browser and also this app: https://itunes.apple.com/us/app/webview-wkwebview-uiwebview/id928647773?mt=8
The app in the link allows you to test the performance in both UIWebView and WKWebView.
I've noticed after profiling in instruments that my app uses about 30-40% more cpu in cordova than when running in the app above. I have tried using both UIWebView and the experimental WKWebView plugin from Telerik. I have even tried pointing cordova directly to a webserver with the contents of my app.
No matter what I strip out or try, my app runs considerably slower in cordova. If cordova and the app store app use the same webviews (presumably), why would the former consume so much more cpu?
Any insight into where the overhead is in cordova would be greatly appreciated.
Thanks!
We've found that adding a (almost hidden) UIToolbar to the cordova project (to the MainController.view) improves performance. Strange but true...

Slow initial loadingscreen iOS web app

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.
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.
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.

iOS webapp performance safari vs home screen start

I read an article recently which states that web apps on iOS launched from the home screen running in full screen mode have slower performance than webapps running inside safari.
Then I found a followup article to it which seems to sugguest that the issue above is fixed.
Does anyone know if this is confirmed?
According to information from appleinsider, ios5 beta fixes that problem and now Nitro JavaScript engine enabled on Web.app.
I've iOS 5 installed on my iphone4 and updated SunSpider JavaScript testing framework 0.9.1 (to be able to start as fullscreen web application under ios). And I've started subspider several times in fullscreen webapp mode and in Safari mobile. So, see my results below (images are clickable):
May be something was fixed (apple insider provides 4 vs 10 seconds difference), but I can't say that performance is equals in both cases (3756.5ms vs 5243.8ms for those who can't see images).
UPD
Small interesting note about UIWebView, it is impossible to use Nitro-enabled JavaScript engine in native applications (I mean applications designed in Xcode and posted to AppStore) because Nitro JIT requires to be able to use dynamic code signing.
UPD
Look at iOS 5 Top 10 Browser Performance Changes on blaze.io, Seems Apple enabled Nitro for Fullscreen WebApps in iOS5 (nice statistics in article).

Resources