Type: perf
Ionic Version: 2.x
Platform: android 6.0 webview
In the Release Candidates my compiled android app (in dev mode) would boot up approx 6 seconds.
now in the final version of ionic2 it takes nearly 25 seconds to boot, what is going on? Even if i do enabledProMode() it has no effect
I'm so confused whats happening and I need this fixed asap, any feedback would be appreciated
For me also the same is happening. In Final it takes around 25 seconds to load the app, But RC 2 was faster. Can any one suggest a solution ? Is there a way to switch to RC 2 back from final ?
did you tried ionic build android --prod. This for me works. Loads ~5sec
I am trying with this flag, But every time I am getting a dev build , I think that is the problem, This is my platform details
ordova CLI: 6.3.1
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v5.4.0
Xcode version: Not installed
is it because of pretty older versions ?
May be they change something in 2.2.0... I'm currently on 2.1.0
Just tested with 2.2.0 - same 4-5 secs load. For me everything ok.
ok Thanks nonamez, I am trying to migrate, As my storage module breaks with 2.2.0, will update you soon
@nonamez , With 2.2.0 and production flag , I am able to get 8-10 seconds. Still it is high, waiting for ionic to fix this. Can I get involved in this tweaking? any branch gives some related information ?
@sarinsukumar After this issue was opend now multiple times, Ionic is still over this and with version 3 (after the latest meeting notes) there will be a lazy-load component which should give a speed up here.
Have a look here
or
@graphefruit Sorry i'm not sure what you mean by "Ionic is still over this", even if they add a lazy-load component, how is that addressing the fact that in RC2 is was quick but now in Final its slow.
My app is a larger app but not humongous by any size, approximately 20 - 25 pages, The app compiles without the --prod flag(but startup is very slow), however with the --prod flag it errors our with a javascript memory heap issue.
@kengreenly I mean, Ionic is aware about this problem of slow start times, and they are working on it to reduce the build size of the main.js which will be the output result for the app.
The startup without the --prod flag is slow because it needs to simply said "bootstrap", which is already taken place while using --prod.
When you run into a memory heap issue make sure to create a sample ionic project and try to compile this one with --prod normaly 90% of all issues i've seen here so far where customer code related.
I cant speak for Ionic or their intentions to release the "final" version, but sometimes you need to do a "cut" and have a futher look, even if its slower then Ionic 1, its stable and the API is fixed.
Dan and other Ionic member told all of this upcoming issues that they are on this topic and they are trying their best e.g.: http://blog.ionic.io/help-us-test-ionic-native-3-x/
The issue which the slow startup time isn't just ionic related, its also angular related and they are working both hardly together to get it working in the best case possible.
If you cant believe it, look into the app-scripts, app-native and in this repo and search for all topics where the topic performance/loading etc. was discussed.
Also dan gave a huge comment about this topic: https://github.com/driftyco/ionic/issues/8102#issuecomment-276705837
My 2 cents to this topic.
Hello all! I would really urge you guys to read dans comment that @graphefruit linked to above, it will give you a good perspective of how hard we are working on this. By calling the 2.0.0 release 'final', we did not mean that was the last version or anything or that we were not going to continue to improve, in fact the upcoming 3.0 release has a ton of changes coming that are specifically for load time, so much so that the 3.0.0 release is almost exclusively focused on load time. I could go on and on here, but will stop for now and urge you to read dans comment linked to above. Thanks everyone for using Ionic!
@graphefruit That comment is from September 2016, it still hasn't been resolved in March 2017?
On another note when i compiled in --prod for android i get the memory heap issue
i tried the fix mentioned here
https://github.com/driftyco/ionic-app-scripts/pull/768
However that doesn't actually work for windows users who are compiling, the flag has no effect, you need to modify the actual CMD file node_modules\.bin\ionic-app-scripts.cmd with the following code
```
`@IF EXIST "%~dp0node.exe" (
"%~dp0node.exe --max_old_space_size=2048 " "%~dp0..\@ionicapp-scripts\bin\ionic-app-scripts.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node --max_old_space_size=2048 "%~dp0..\@ionicapp-scripts\bin\ionic-app-scripts.js" %*
)
````
ALSO the --prod flag doesnt work from cmd, you need ot modify the package.json file
from
"ionic:build": "ionic-app-scripts build",
to
"ionic:build": "ionic-app-scripts build --prod",
Then i was able to compile, this also reduced startup times from about 25seconds to approx 7 or 8
It seems most of the fixes mentioned apply to linux/mac users and not windows, hope this helps fellow windows users
@jgw96 please see my above comment
@kengreenly awesome information. I was whole day looking for the fixes and thank you very much.
@ionic team Its a great and really the best framework I have come across so far. Thank you very much for ionic . Continue your work, and if we can contribute at any point will do it for sure.
@kengreenly i dont get it.. after i run the ionic-app-scripts build --prod , what should i do to deploy to mobile? cause when i run cordova build --release android this gives me the apk and it takes 15s to load
@mariohmol ionic build --prod --release android is that what are you looking for?
@graphefruit thanks for answering.. tryed that before as well.. same issue.. like 15 to 20s to load.. it shows the splash screens.. then open a blank screen until open the login page... the app is really small.. like 7 views.. dont know what else i can do to make it feaseable (form 5 to 10 s)
@mariohmol If your compiling in a windows environment, those flags dont do anything at the command line, you need to put them into the package.json file.
Open package.json
SET:
"build": "ionic-app-scripts --prod",
"ionic:build": "ionic-app-scripts build --prod",
THEN go to command line and execute
ionic build android
it`s mac env... i updated everything about ionic and same thing.. =(
Cordova CLI: 6.5.0
Ionic Framework Version: 3.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.7
ios-deploy version: 1.9.1
ios-sim version: 3.1.1
OS: macOS Sierra
Node Version: v6.3.1
Xcode version: Xcode 8.3.2 Build version 8E2002
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Most helpful comment
@graphefruit That comment is from September 2016, it still hasn't been resolved in March 2017?
On another note when i compiled in --prod for android i get the memory heap issue
i tried the fix mentioned here
https://github.com/driftyco/ionic-app-scripts/pull/768
However that doesn't actually work for windows users who are compiling, the flag has no effect, you need to modify the actual CMD file node_modules\.bin\ionic-app-scripts.cmd with the following code
```
`@IF EXIST "%~dp0node.exe" (
"%~dp0node.exe --max_old_space_size=2048 " "%~dp0..\@ionicapp-scripts\bin\ionic-app-scripts.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node --max_old_space_size=2048 "%~dp0..\@ionicapp-scripts\bin\ionic-app-scripts.js" %*
)
````
ALSO the --prod flag doesnt work from cmd, you need ot modify the package.json file
from
"ionic:build": "ionic-app-scripts build",
to
"ionic:build": "ionic-app-scripts build --prod",
Then i was able to compile, this also reduced startup times from about 25seconds to approx 7 or 8
It seems most of the fixes mentioned apply to linux/mac users and not windows, hope this helps fellow windows users