App slow on IOS

Hi brandy, I just created a github repo with the info, didn’t noticed there is a template. I’ll correct to the proper format as soon as I can.

Also, this issue just happens in actual device, in PC browser (safari, firefox, chrome) runs great, don’t know if it can be reproduced in plunker.

Meanwhile to anyone interested, the link to the repo I created is: https://github.com/gerhardx/slowIOs

1 Like

I’m happy to see that I am not the only one with this issue… I’ve been developing the app for months in the browser and everything works like a charm. Recently tried it on iOS and got the biggest disappointment of my life. Like people said here, working well on Android 5+, but it’s a total crap on iOS. I guess (and hope) it is because Angular 2 AND Ionic2 are both still in beta stage, and it will be good in the next months; Cause so far, Ionic1 is giving better performances so…

1 Like

Is this issue fixed yet?

Usually the performance issues will not be very visible in pc browsers since they have access to more ram and cpu resources than your typical mobile device, however it’s worth mentioning that ios should run faster than android, also idk how would they compare with XWalk.

Hey everyone. Thanks so much for bringing this to our attention and sorry for the bad experience. We’re all hands on deck trying to figure out what’s going on here, and we have some leads that point to beta ng2 things (template compilation, etc.).

More updates soon…

Hello all! Thanks for bringing this to our attention. After doing some profiling it seems that most of the delay seen in the above example (thanks @gerardx20 for the repo!) seems to stem from using an external template. From what I can see with chrome dev tools their is 323.27ms spent in xhr calls retrieving the html files for the templates. As an experiment I tried using inline templates instead for both the tabs file and the first tab page and noticed a very nice increase in both perceived and real performance. When profiling the app running with inline templates chrome dev tools shows that we are no longer waiting on long xhr calls and are able to immediately move into rendering the tabs page almost immediately after clicking the button to navigate. I have forked gerardx20’s repo and pushed a version with inline templates so that you all can test and see if you come to the same conclusions we have. Please feel free to test and comment with your findings. Thanks for using Ionic!

2 Likes

323 isn’t much…
BTW

This is an isolated test case that demonstrates some order of magnitude overhead for template URLs currently. Can we apply that to a bigger app for more gains? That’s what we’re trying to test right now.

Also ng1 isn’t ng2.

If someone can try that test case above and let us know if converting the template urls to inline template strings helps the issue and that will give us a lead on where to go next.

I understand that ng1 isn’t ng2. ng2 doesn’t make ng-templates.js (with template cache), does it?
However iOS only have this problem, why do it work fine on Android?

Hm… I haven’t iPhone, so I checked my apps on iOS emulator (macbook pro 2015) and it works without the big delay. Actually I don’t see the deference between iOS and Android. Maybe because my apps isn’t big: 4 components, 7 pages and 2 modals ~ 14 html files.

Thanks for your response jgw96, I’ve tested your repo with an iPad mini 2, and indeed there’s an increase of speed.

In the original test with the iPad mini 2 takes between 2 to 3 seconds to change view, with the change in your repo the same iPad mini 2 is between 1 to 2 seconds, but still is noticeable compared to android.

I’ll be testing on iPhone 6s, and be posting results as soon as I get some free time.

I’ve uploaded an screencast with the new app, for compare purposes.
The original screencast link is in the repo.

Thanks for testing @gerardx20 ! Really appreciate it. Can’t wait to hear the results from your iPhone test. If you don’t mind me asking what device are you using for your Android testing?

2 things that might help improve performance:

1- Install crosswalk

2- Enable production mode on Angular 2
import {enableProdMode} from “@angular/core”;
enableProdMode();

Thanks for the reply @max and @jgw9617 Wait & see then :slight_smile:

That is very weird… The issue would come from Angular then ?

1 Like

Already in prod mode and that does not change much.

Testing the inline solution on iPhone 6s is much better, you can barely notice the delay, is still there but change is almost instant.

jgw9617: Thanks for the reply, I tested in 2 android devices:

1: Lanix Ilium PAD i7 (only supports android 4.4, no more), is so slow, but gets much better with crosswalk

2: LG G3 (2014 model), with Android 5.0.

So, Guess the inline solution is the way to go with IOS devices, at least for now.

Thanks to Ionic team for the replies!!

2 Likes

Awesome to hear that. We’re going to switch the templates to inline in the starters in the meantime.

Also today we had the first successful integration of Angular 2’s new offline template compiling stuff which will render this entire issue moot. Templates will be pre-compiled into a more efficient format which will get us performance above what we have now, but also above Ionic 1 w/ angular 1. Then we will release the RC :smiling_imp:.

5 Likes

Awesome ! Do we have a chance to see this in beta11 ?

1 Like

That’s great!. Waiting the RC!!

Great job you do ionic team!

Cant wait =)) thanks for the wonderful work.