Roadmap › Angular (2 → 21) › Module: Quality and Performance
Lessons in this course (16)

16. Performance optimisation

Advanced★ Must knowLesson 16 of 16
  1. OnPush everywhere + immutable data + signals; consider zoneless.
  2. Lazy load routes (loadComponent/loadChildren) and @defer heavy blocks.
  3. track in @for (or trackBy) to avoid re-rendering lists.
  4. Virtual scrolling (cdk-virtual-scroll-viewport) for long lists.
  5. Avoid function calls in templates (use computed/pure pipes).
  6. Unsubscribe (async pipe, takeUntilDestroyed) to prevent leaks.
  7. SSR + hydration (@angular/ssr, incremental hydration) for first paint and SEO; prerender static routes.
  8. NgOptimizedImage (ngSrc) for images; budgets in angular.json; analyse bundles (ng build --stats-json + esbuild/webpack analyzers).
  9. Web Workers for heavy computation; preloading strategies.
  10. Production builds (AOT, tree-shaking, minification are default).