Reputation: 11628
I have an Angular10 web application.
While analyzing the performance with DevTools I noticed that the click
event takes quite a long time, most of it is spent doing nothing, then a globalZoneAwareCallback
is called followed by a microtask
Here's a snapshot of the flame chart. When the user clicks on a button, the task takes several milliseconds (in this case 107ms) but most of the time is spent doing nothing.
Is this expected or there's something I'm missing? I do use the default change detection strategy.
Is that an idle time or is the app doing something really time consuming?
EDIT
I found out that only the first time the event takes quite a significant bit of time (some initialization going on?). Subsequent events are in a reasonable range (40ms-50ms).
Upvotes: 2
Views: 559
Reputation: 11628
Initialization or some other operations done by Angular. Subsequent events don't show the problem
Upvotes: 1