Web Performance Fundamentals
React web performance best practices based on "Web Performance Fundamentals" by Nadia Makarevich.
Investigation Workflow
When addressing a performance issue:
- Identify the affected metric (FCP, LCP, INP, TTFB) -- see thresholds in
references/initial-load.md. - Read the relevant reference file below based on the problem area.
- Apply the recommended technique.
- Measure again on a production build in Guest/Incognito mode to confirm improvement.
Reference Guides
Read the relevant reference file based on the performance area being addressed:
Initial Load: Core Web Vitals, render-blocking resources, CDN, caching, CSR vs SSR tradeoffs, flame graph analysis. Read when investigating FCP/LCP/TTFB issues or configuring cache headers.
Bundle Size: Compression, chunk splitting, tree shaking, bundle analysis, dependency auditing. Read when bundle is too large, adding new dependencies, or configuring build output.
Lazy Loading: React.lazy, Suspense, route-based splitting, preloading strategies, SSR considerations. Read when implementing code splitting or lazy-loaded components.
SSR: Server-side rendering, hydration, SSG, React Server Components, streaming, data fetching patterns. Read when configuring SSR behavior, fixing hydration issues, or working with RSC.
Interactions: INP optimization, long tasks, re-render elimination, state management patterns, memoization. Read when fixing slow interactions or unnecessary re-renders.
React Compiler: Automatic memoization, limitations, adoption guidance. Read only when the project already uses React Compiler or the user is explicitly evaluating its adoption.