What problem does it solve?
Identifies front-end performance regressions across the codebase by auditing bundle size, image delivery, unnecessary re-renders, expensive client-side computations, animation costs, network waterfall patterns, Socket.io lifecycle issues, and React Query cache misconfiguration to improve load time and runtime responsiveness.
Core Features & Use Cases
- Bundle size analysis: Find heavy imports and recommend code-splitting or lazy-loading for components like canvas animations, animated text, and markdown preview renderers.
- Image optimization: Detect missing loading attributes, absent width/height leading to CLS, and opportunities to convert assets to WebP/AVIF.
- Render and compute hotspots: Surface components causing excessive re-renders (recursive comment trees, poll, editor), expensive inline computations, and missing useMemo/useCallback patterns.
- Network and caching: Identify waterfall fetch patterns, opportunities for useQueries or route-level prefetching, and React Query staleTime/gcTime improvements.
- Animation & sockets: Verify rAF cancellation, DPR scaling, Framer Motion object stability, and Socket.io connection/handler cleanup to avoid leaks.
- Use case: Produce an actionable Pass 4 report for the Cebu Airsoft Hub that prioritizes fixes for the landing page and most-used routes (feed, post detail).
Quick Start
Run a Pass 4 performance audit on the repository root and generate the report at docs/code-review/pass-4-performance.md.