| name | performance-review |
| description | Performance analysis checklist for code review |
Performance Review Skill
Systematic performance analysis for code changes. Use during the performance pass of /review or when optimizing. See 25_caching_performance.md rule for implementation standards.
Checklist
Backend — Database
Backend — Caching
Backend — Application
Backend — Redis
Frontend — Rendering
Frontend — Data Fetching & Caching
Infrastructure — HTTP & CDN
Red Flags
These patterns almost always indicate a performance problem:
| Pattern | Issue | Fix |
|---|
Model::all() | Loads entire table | paginate() or scoped query |
foreach ($items as $item) { $item->relation } | N+1 | $items->load('relation') |
DB:: inside a loop | Repeated queries | Batch query before the loop |
sleep() in request | Blocks worker | Queue job |
file_get_contents() for URLs | No timeout, blocking | HTTP client with timeout, or queue |
Cache::forever() without invalidation | Stale data after changes | Version keys or tag-flush on deploy |
Cache::remember() returning null | Infinite re-computation | Wrap in DTO or sentinel |
Caching with public on auth responses | Data leaks between users | private or no-store |
Cache::tags() with file driver | Runtime exception | Enforce Redis driver |
Raw fetch() in Nuxt lifecycle hooks | No SSR dedup, no caching | useFetch / useAsyncData |
Missing key on useFetch | Cache collisions | Always set explicit key |