App slow start up

Hi all,

I know there are already a couple of topics about slow start-up times, but I in my case my app started quickly on iOS (3-4 seconds) before, but now starts up really slowly (~13 seconds). I cannot find out what changes I made causes this. I tried out the Ionic blank starter project and it starts up quickly (3 seconds) on my iPhone 6S.

This is the log in XCode:

2018-03-03 15:11:01.383052+0100 Apache Cordova native platform version 4.5.3 is starting.
2018-03-03 15:11:01.384976+0100 Multi-tasking -> Device: YES, App: YES
2018-03-03 15:11:01.417479+0100 CDVWKWebViewEngine: trying to inject XHR polyfill
2018-03-03 15:11:01.543967+0100 [MC] Lazy loading NSBundle MobileCoreServices.framework
2018-03-03 15:11:01.545974+0100 [MC] Loaded MobileCoreServices.framework
2018-03-03 15:11:01.557626+0100 CDVWKWebViewEngine will reload WKWebView if required on resume
2018-03-03 15:11:01.557762+0100 Using Ionic WKWebView
2018-03-03 15:11:01.559614+0100 [CDVTimer][console] 0.295997ms
2018-03-03 15:11:01.560097+0100 [CDVTimer][handleopenurl] 0.306010ms
2018-03-03 15:11:01.566991+0100 Unlimited access to network resources
2018-03-03 15:11:01.567260+0100 [CDVTimer][intentandnavigationfilter] 7.053971ms
2018-03-03 15:11:01.567595+0100 [CDVTimer][gesturehandler] 0.253916ms
2018-03-03 15:11:01.618503+0100 [CDVTimer][diagnostic] 50.814986ms
2018-03-03 15:11:01.618839+0100 CDVIonicKeyboard: resize mode 3
2018-03-03 15:11:01.621676+0100 [CDVTimer][keyboard] 2.905011ms
2018-03-03 15:11:01.628477+0100 [CDVTimer][file] 6.630063ms
2018-03-03 15:11:01.661072+0100 [CDVTimer][splashscreen] 32.433987ms
2018-03-03 15:11:01.683072+0100 [CDVTimer][statusbar] 21.767020ms
2018-03-03 15:11:01.683234+0100 [CDVTimer][TotalPluginStartup] 124.732018ms
2018-03-03 15:11:08.643698+0100 Ionic Native: deviceready event fired after 3955 ms
2018-03-03 15:11:14.277390+0100 Platform ready

Output of ionic info:

cli packages:

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.2
    ios-sim    : 6.1.2
    Node       : v9.5.0
    npm        : 2.15.12
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

The plugins that are installed:

cordova-custom-config 5.0.2 "cordova-custom-config"
cordova-plugin-audioinput 0.3.0 "Audio Input"
cordova-plugin-camera 4.0.2 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-console 1.1.0 "Console"
cordova-plugin-crosswalk-webview 2.4.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-media 5.0.2 "Media"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.1 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 2.2.1 "Cordova sqlite storage plugin"
cordova.plugins.diagnostic 3.9.2 "Diagnostic"

Did you maybe forgot the --prod while building the app you are testing? that would explain why suddenly it went from 4 to 13 seconds

1 Like

due to crosswalk app size increases and it will be slow .
remove crosswalk plugin if it is absolutely not necessary .

that’s not true / not correct, using XWalk won’t slow that much the boot time. The main effect on boot time is the size of the bundle and assets to be loaded (summarized).

that’s correct if you use Android >= 5

I found some interesting about crosswalk
ionic_Crosswalk and
app size increased

So i thought app size increases and running will be slow.

bundle size and assets are boot time worst enemy. that’s one of the reason why for Ionic 4 the Ionic team is rewriting everything with web component (= Stencil built)

you could find some investigation I did about boot time in that post https://forum.ionicframework.com/t/app-boot-time-current-state-and-best-practices/

1 Like

Thanks for the suggestion. I’m already using the --prod flag though.

1 Like

Did you add some console.log to see if the slowness is really a problem of loading the bundles or if maybe a network query or something is now slow?

Also I guess you are using lazy loading…