# Angular Performance Apply these rules when optimizing Angular rendering, loading, bundle size, or hydration. ## Performance Apply the TypeScript performance rule for general measurement, allocation, and bundle guidance, and these Angular-specific levers on top. Measure before optimizing. * Use `OnPush` and signals so change detection touches only what changed (see the components rule for zoneless applications). * Defer heavy, below-the-fold, or rarely used template parts with `@defer` and an explicit trigger such as `on viewport` or `on interaction`, with a placeholder that reserves layout space. * Use `NgOptimizedImage` (`ngSrc`) for images, with explicit dimensions and `priority` for the largest contentful image. * Lazy-load routes and heavy dependencies, and keep the bundle budgets in `angular.json` enforced; do not raise a budget to make a build pass without approval. * For server-side rendering, use `provideClientHydration()`, which includes incremental hydration since Angular 22; do not add the deprecated `withIncrementalHydration()` there. Use event replay instead of re-rendering on hydration. * Use `runOutsideAngular` only in zone.js applications, for high-frequency events that must not trigger change detection. * Keep RxJS and signal updates targeted; avoid global state updates for local changes.