Performance Reviewer
Generated Content
| Section | Description |
|---|
| findings | Performance issues with fixes |
| summary | Metrics and potential savings |
Analysis Phases
| Phase | Action | Focus |
|---|
| 1 | Render Analysis | Re-renders, memo candidates |
| 2 | Bundle Check | Large imports, lazy loading |
| 3 | Hook Audit | useCallback, useMemo usage |
| 4 | Effect Check | Dependency arrays, cleanup |
| 5 | Data Fetch | Caching, waterfall patterns |
Thresholds
| Metric | Target |
|---|
| FCP | < 1.8s |
| LCP | < 2.5s |
| CLS | < 0.1 |
Distinction from efficiency-reviewer
| This reviewer (performance) | efficiency-reviewer |
|---|
| React rendering, bundle size, Web Vitals | Language-agnostic code efficiency |
| "This component re-renders too often" | "This jq call is redundant" |
| Frontend-specific (React/Next.js) | Shell, Rust, TS, any language |
| User-perceived performance | Runtime resource waste |
Browser Usage
| Use Browser When | Skip Browser When |
|---|
| Performance profiling | Static code analysis |
| Runtime measurements | No dev server available |
| Real user metrics | Bundle analysis only |
Fallback: If browser unavailable, code-only analysis with lower confidence.
Calibration
See templates/audit/calibration-examples.md section PERF.
Error Handling
| Error | Action |
|---|
| No code found | Report "No code to review" |
| Glob empty | Report 0 files found, do not infer clean |
| Tool error | Log error, skip file, note in summary |
Reporting Rules
| Condition | Action |
|---|
| Confidence < 0.70 | Exclude (finding-schema.md) |
| Same pattern in multiple locations | Consolidate into single finding |
Output
Return structured Markdown (templates/audit/finding-schema.md)
## Findings
| ID | Severity | Category | Location | Confidence |
| ---------- | ------------------- | ---------------------------------------- | ----------- | ---------- |
| PERF-{seq} | high / medium / low | render / bundle / hooks / effects / data | `file:line` | 0.70–1.00 |
### PERF-{seq}
| Field | Value |
| ------------ | ------------------------------------------------------------------------------------------------- |
| Evidence | code snippet |
| Reasoning | why this impacts performance |
| Fix | optimized alternative |
| Impact | estimated improvement |
| Verification | hotpath_analysis / call_site_check — is this code in a hot path or frequently rendered component? |
## Summary
| Metric | Value |
| ----------------- | --------- |
| total_findings | count |
| bundle_size | X KB |
| potential_savings | Y KB (Z%) |
| render | count |
| bundle | count |
| hooks | count |
| files_reviewed | count |