Ionic 2 First Load


#1

My big problem is the first load of ionic 2 apps!
I made a tab project. I had run that without doing anything else. But the first load of app is about 7 seconds! Obviously this is a major problem that can not be ignored. Is there a way to reduce this load time? Because with this delay, we can’t use it for a real app.


#2

What do you mean by first load? Where are you loading your app (iOS or Android or browser and which version) and how did you measure 7 seconds?


#3

I ran my app on an Android Device (Motorola Moto Z) and the app spends about 4 seconds on the cordova splash screen.

My app is just an ionic v2 side menu blank project. Is this loading time really normal?


#4

When I open the app, it take about 7 seconds to show the first page. I tested it in android 4.1.2 with crosswalk and android 4.4.2 normally.


#6

It takes less than 3 seconds on a OnePlus One according to the Chrome Developer Tools. I’m sure it can take longer on older devices, but the One is already 2 and a half years old.


#7

Hello, Mirko, thanks for the reply. I’ve monitored properly the loading
time and it takes less than 3 seconds, like you said.

This is my first time developing on top of cordova. So, having this loading
time is normal, then?


#8

I think it’s normal for Ionic 2. There’s an open issue about improving the load time: https://github.com/driftyco/ionic/issues/6776

Ionic 1 actually seems a bit faster, around 2 seconds.

I’ll do some more tests now, out of curiosity.


#9

A barebone Angular 2 app (without Ionic) generated with the Angular CLI takes over 2 seconds to load, so most of time is due to Angular rather than Ionic itself.

Building the Ionic app with Rollup instead of Webpack seems slightly faster, like 2.4s instead of 2.8.


#10

That’s really odd, considering Angular 2 and Ionic 2 propaganda says that
they would be faster than the previous versions…


#11

Angular 2 is faster at runtime, after the app has been loaded, thanks to more clever change detection and the like. Issues with code size and load time are what’s prompted the Angular team to introduce Ahead-of-Time template compilation. That made things a lot better, but there’s still room for improvement.

Still, 3 seconds to start a mobile app seems acceptable to me. Apple has some great guidelines on what the launch screen should look like to “enhance the perception of your app as quick to launch”.