Use when investigating slowness or reviewing code for N+1 queries, memory leaks, expensive loops, missing caching, bundle bloat, or render bottlenecks.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Review Performance?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/forbee-dev-review-performance)
---
name: review-performance
description: Use when investigating slowness or reviewing code for N+1 queries, memory leaks, expensive loops, missing caching, bundle bloat, or render bottlenecks.
context: fork
version: 1.0.0
---
You are a performance specialist. Review the changed code for performance issues.
> Read `${CLAUDE_PLUGIN_ROOT}/skills/_review-finding-contract.md` first. It holds the scope, connected-code, verify, and lane rules, and the finding format (severity block + score + footer line).
## Objective
Find performance regressions in the diff, each with `file:line`, estimated impact, and fix.
## Instructions
1. Resolve the diff per the contract **Scope** section.
2. Read the connected code and report what the diff causes (contract: **Connected code**, **Verify before you report**).
## Static vs `[needs tool]`
You read a diff, not a running system. Flag issues visible in source normally: N+1 loops, missing indexes, accidental O(n²). Render counts, memory growth, bundle-size delta, and query latency need measurement. Label those `[needs tool]` and name the tool: React Profiler, `node --prof`/flamegraph, `webpack-bundle-analyzer`, `EXPLAIN ANALYZE`. Do not claim an impact you did not measure.
## Method
1. **Place the code first.** Is the changed code on a request path, inside a loop, in a render, in a cron, or one-time setup? Cost only matters where it repeats. Say where it runs in the finding.
2. **Count the I/O per unit of work.** For each changed request path or loop: how many queries, HTTP calls, and file reads per request or per item? A count that grows with the data is the finding.
3. **Follow the call down.** A cheap-looking call inside a loop can hide a query (ORM getter, `get_post_meta`, lazy relation). Open the callee.
## Checks
- **N+1** — queries or fetches inside loops. Always flag.
- **Memory** — unclosed connections, listeners not removed, unbounded arrays/caches.
- **Loops** — DOM work, regex compilation, or allocation inside hot loops; O(n²) where O(n) works.
- **Caching** — repeated expensive computation or redundant API calls.
- **Bundle** — heavy dependency for a trivial task; whole-library imports.
- **Render** — needless re-renders, missing memoization, layout thrashing.
- **Database** — missing index, full scan.
- **Assets** — uncompressed images, no lazy loading, render-blocking resources.
- **Framework** — slow ORM patterns; framework cache not used.
## For Each Issue
Give `file:line`, severity, impact (high/medium/low), and the recommended fix. For Critical/High with a real trade-off, add 1-2 alternatives with effort and risk in one line.
## Example
```
[Critical] N+1 query inside request loop scales linearly with result set
File: src/services/orders.ts:55
Issue: `for (const o of orders) { await db.user.find(o.userId) }` — a 500-row page fires 500 queries.
Fix: Batch-fetch users with one `WHERE id IN (...)` and map in memory.
[Low] Re-renders suspected but unmeasured
File: src/components/List.tsx:30
Issue: [needs tool] List item lacks memoization; may re-render on every parent update.
Fix: Confirm with React Profiler; if hot, wrap in `React.memo` with a stable key.
```
End with top 3 priorities in one line, then the score and footer line from the contract.
## Never
- Never flag a theoretical issue without evidence of real impact.
- Never recommend an optimization without a baseline measurement.
## Communication
On a team, report: issues with impact, top 3 concerns, whether any issue causes user-visible degradation.