angular-performance

Optimizes Angular apps with NgOptimizedImage, @defer lazy loading, routes, SSR/Hydration, memoization and pure pipes for computations.

618|89|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/Gentleman-Programming/Gentleman-Skills --skill angular-performance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-performance
Source: https://github.com/Gentleman-Programming/Gentleman-Skills/tree/main/curated/angular/performance
Command: npx skills add https://github.com/Gentleman-Programming/Gentleman-Skills --skill angular-performance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers optimize Angular app performance by guiding best practices for image optimization, deferred loading, and SSR decisions.

Core Features & Use Cases

  • NgOptimizedImage guidance: ensure width/height, ngSrc usage, and priority handling for LCP.
  • @defer lazy components: load heavy components on viewport or interaction with placeholders.
  • Lazy Routes and SSR/Hydration: choose CSR vs SSR/SSG, and configure hydration in bootstrap.
  • Slow Computations: optimize expensive computations with memoization, pure pipes and derived signals.

Quick Start

Use this Skill to audit and apply image optimization and lazy loading patterns in your Angular project, then verify performance improvements.

Frequently Asked Questions about angular-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize images in Angular to improve page load times?

Image optimization in Angular uses NgOptimizedImage to enforce width/height attributes, lazy-load images, and prioritize LCP candidates. This prevents layout shift and reduces initial load time by deferring off-screen images until needed.

What's the best way to lazy-load heavy components in Angular?

@defer blocks load expensive components on viewport visibility or user interaction, displaying placeholders while loading. This reduces initial bundle size and improves time-to-interactive for route-based apps.

Should I use server-side rendering or client-side rendering for my Angular app?

SSR pre-renders content on the server for faster first paint and SEO; CSR renders in the browser. Choose SSR for content-heavy or SEO-critical pages; configure hydration to avoid rerendering after initial load.

Can I use lazy routes with image optimization in the same Angular app?

Yes. Lazy routes split code by feature, and NgOptimizedImage optimizes images within each route. Combined, they reduce initial payload and defer loading of route-specific assets until navigation.

How do I handle slow computations in Angular templates?

Optimize expensive calculations with memoization, pure pipes, and derived signals. These techniques prevent unnecessary recomputation during change detection and improve rendering performance.

What Angular version and dependencies do I need for image optimization?

NgOptimizedImage and @defer are built into modern Angular; @defer requires Angular 17+. No external dependencies needed—both are part of the framework's core APIs.