Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 3 reduce startup time

I'm working on an Ionic 3 application (for Android only). Everything works great, except that the startup time of my App is a bit long (nothing excessive, but like 4~5 seconds) and some users are complaining about it. I'm pretty sure it is possible to do better as I have other Ionic apps that rarely take more than 2 seconds to launch. (I'm hiding the splash screen myself, once platform.ready() is called)

Now, I'm already using some of the techniques I often read about : I'm calling enableProdMode() and compiling with the --prod flag. I also added ProGuard (wasn't meant to speed things up but can still reduce number of Java classes so why not), and I tried using Crosswalk but it resulted in worse performances.

So I'm looking for the next step : I'm trying to diagnose what happens during the splash screen, and what can I do better. But I can't find a way to get numbers or stats about what takes long and where is the problem. Instinctively, I'd say that reducing the number of Angular classes by refactoring some views and reducing the number of native plugins in my code could help, but I have found no evidence of it.

So my two questions are :

  • Is there a way to see what takes time during the splash screen, before platform.ready is called ?
  • Are there general tips such as reducing the number of plugins or classes to improve startup time ?
like image 229
Kewin Dousse Avatar asked Oct 31 '17 08:10

Kewin Dousse


People also ask

How to improve startup time of ionic applications?

One such issue is startup time of Ionic applications, with more views an application startup time increases many folds due to a number of components loading at once during app initialization. We can improve this situation by Lazy Loading component in the application. What is Lazy Loading?

Is ionifits a Zenefits for angular performance?

The following post reviews Stephen’s Angular performance tips applied through the lens of an Ionic app, Ionifits, a Zenefits-inspired human resources demo app. It showcases various Ionic App Platform technologies, including Ionic Framework, Capacitor, and Ionic Native Enterprise solutions.

What are the ionic app platform technologies?

It showcases various Ionic App Platform technologies, including Ionic Framework, Capacitor, and Ionic Native Enterprise solutions. Try it out on the web, iOS, or Android.

What are the performance issues with Ionic Framework?

An Ionic framework application makes development very easy and fast for multiple platforms, but sometimes due to performance issues like fluctuation in animations, jerk movements during user interactions calls for some tricky solutions to manage code with better optimizations.


1 Answers

You need to use the Lazy Loading. So you will have not all the pages and plugins loaded at startup. The Lazy Loading allow you to load just the page and plugins if it's called.

Here is some links to help you to solve the problem :

http://blog.ionic.io/ionic-and-lazy-loading-pt-1/

http://blog.ionic.io/ionic-and-lazy-loading-pt-2/

Hope it helps.

like image 197
fandro Avatar answered Oct 13 '22 15:10

fandro