I’m trying to speed up our app launch time and I’ve found a long-ish delay between ngAfterViewInit and ionViewWillEnter. I’ve moved all my code into ionViewDidEnter and
constructor(…){
console.time();
console.log(‘Forecast constructor’)
console.timeLog();
}
ngOnInit() {
console.log(‘Forecast ngOnInit’)
console.timeLog();
console.timeStamp(‘Forecast ngOnInit’);
}
ionViewWillEnter() {
console.log('Forecast ionViewWillEnter')
console.timeLog();
console.timeStamp('Forecast ionViewWillEnter');
}
ionViewDidEnter() {
console.log('Forecast ionViewDidEnter start')
console.timeLog();
…}
and this is the output
vendor.js:43681 Ionic Native: deviceready event fired after 236 ms
15:41:43.099 forecast-forecast-module.js:125292 Forecast constructor
15:41:43.118 forecast-forecast-module.js:125293 default: 18.72314453125 ms
15:41:43.148 forecast-forecast-module.js:125301 Forecast ngOnInit
15:41:43.148 forecast-forecast-module.js:125302 default: 48.5029296875 ms
15:41:43.152 forecast-forecast-module.js:125319 Forecast ngAfterViewInit
15:41:43.152 forecast-forecast-module.js:125320 default: 52.4951171875 ms
15:41:43.469 forecast-forecast-module.js:125296 Forecast ionViewWillEnter
15:41:43.469 forecast-forecast-module.js:125297 default: 369.56787109375 ms
As you can see there’s +300ms between the empty ngAfterViewInit and ionViewWillEnter. That’s actually the lowest I have seen. Is there something I can do to get that number even lower?
1 post - 1 participant