Performance

From dean0x/devflow · View interactive version

Performance is an AI agent skill from the GitHub repository dean0x/devflow. Use when reviewing code for N+1 queries or memory leaks.

How to use this skill

Skill file

Performance Patterns

Detection patterns for performance and bottleneck review. Use with devflow:review-methodology.

Iron Law

Measure before optimizing.

Profile first, optimize second. Every performance claim requires benchmarks. Brendan

Gregg's USE Method (Utilization, Saturation, Errors) and Tom Wilkie's RED Method

(Rate, Errors, Duration) are the systematic starting points — not guesswork.

Gil Tene's coordinated omission warning: averages lie — monitor P99, not mean latency.

Measurement tools: flame graphs for CPU hot paths (widest frames are hottest), HDR histograms for full latency distributions.

Performance Categories

1. Algorithmic Issues

2. Memory Issues

3. I/O Issues

4. Database Issues

Missing indexes, SELECT *, OFFSET pagination on large tables, LIKE with leading wildcard. See references/violations.md.

5. Frontend / Web Vitals

| Metric | Good | Poor | Measures |

|--------|------|------|---------|

| LCP | < 2.5s | > 4s | Largest element load |

| INP | < 200ms | > 500ms | Input responsiveness |

| CLS | < 0.1 | > 0.25 | Layout stability |

Unnecessary re-renders, missing virtualization, missing code splitting. See references/violations.md.

Extended References

| Reference | Content |

|-----------|---------|

| references/sources.md | Full bibliography (25 sources) |

| references/violations.md | Extended violations |

| references/patterns.md | Correct patterns |

| references/detection.md | Grep commands, profiling, CI integration |

Severity Guidelines

| Severity | Examples |

|----------|----------|

| CRITICAL | N+1 with unbounded data, memory leaks, blocking I/O in handlers |

| HIGH | Sequential async, SELECT *, unbounded caches, LCP > 4s |

| MEDIUM | Suboptimal algorithm on small data, missing memoization, INP > 200ms |

| LOW | Micro-optimizations, premature optimization candidates |

Quick Detection

In the diff, search for await in a loop or .forEach(async (N+1), readFileSync/writeFileSync (sync I/O) and SELECT *.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.