For context:
I have Angular 5 app whose startup cycle involves:
- Http calls to server APIs (checking token, retrieving user data)
- Local storage (db) calls
- Quite some init process to prepare and transform data
I decided to go through the whole startup cycle using debugger step by step and realized that Angular triggers change detection on many processes during startup cycle.
Now i wonder (question): considering all of the activity before app inits is just to prepare data to be used by the app - should i detach change detection during app init cycle and reattach change detection once init is over and then trigger it?
Basically trying to understand if this is going to save loading time and processing or is that a bad idea?
Update: since I went through a lot of articles re this topic I realized additional facts that might be altering the way I should ask this question.
Change Detection relates to "views" - if there are not templates and bindings in those - it might be not even worth to try to optimize this
For more or less serious app it is a common practice to switch to onPush CD strategy, which also can help eliminate the need for additional improvements here.
Last thing - I will still try the following experiment later today:
- load Ionic/Angular app with detached CDR and then re-attached after init phase is over
- load the same app normally
- then see whats delta (if any at all;)