From the course: Creating Angular Libraries
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Optimizing slow computations - Angular Tutorial
From the course: Creating Angular Libraries
Optimizing slow computations
- [Narrator] Change detection is at the heart of the Angular framework. You want these cycles to be fast, and you want to run them only when you need to. On every change detection cycle, Angular first evaluates the template expressions inside components. It then executes these four lifecycle hooks. A single, slow or expensive computation anywhere in the sequence can slow down the entire change detection cycle because Angular runs these checks in order. A slow computation means a slow change detection cycle, and a slow cycle means choppy and unresponsive UI for your end users. The best way to find slow and expensive computations is by using Angular DevTools, an open source browser extension maintained by the official Angular team. The profiler tab lets you visualize Angulars change detection in real time. The performance timeline right here shows you each change detection cycle as a series of columns. The taller the column, the longer that cycle took to complete. Click on any column to…
Contents
-
-
-
-
-
(Locked)
Common configuration tweaks2m 29s
-
(Locked)
Skipping change detection on component subtrees1m 45s
-
(Locked)
Component view encapsulation2m 41s
-
(Locked)
Isolating injectors within hierarchies4m 37s
-
(Locked)
Optimizing slow computations2m 41s
-
(Locked)
Avoiding zone pollution2m 3s
-
(Locked)
Angular without Zone.js (zoneless)46s
-
(Locked)
Make components portable with Angular Elements5m 16s
-
(Locked)
Coding challenge26s
-
(Locked)
Solution2m 6s
-
(Locked)
-
-