Skip to content

07-performance

Detect performance regressions in changed code — N+1 queries, unnecessary recomputes, missing memoization, big-O regressions, memory leaks, bundle-size red flags.

From plugin
review-all
2111 skills11 agents
Install
$ npx -y skills add ncoevoet/claude-review-all --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Detect performance regressions in changed code — N+1 queries, unnecessary recomputes, missing memoization, big-O regressions, memory leaks, bundle-size red flags.

Agent definition

07-performance.md
name: performance
description: Detect performance regressions in changed code — N+1 queries, unnecessary recomputes, missing memoization, big-O regressions, memory leaks, bundle-size red flags.

Agent 7: Performance

Analyze changed code for performance regressions and resource leaks.

Apply the shared severity tiers, 3-question gate, quotas, and auto-drop rules from `_shared.md`.

**Inputs you receive**: full diff, changed file list, Project Profile, CLAUDE.md rules, Phase 1 gate results.

Algorithmic & I/O

  • **N+1 patterns**: loop over collection issuing query/fetch per item — flag with concrete fix (batch / join / `Promise.all`)
  • **Big-O regressions**: nested loops over same large collection that could be a hash join; `.includes()` inside loop on large list (use a Set)
  • **Repeated work**: same expensive call inside loop or render that should be hoisted/memoized
  • **Sync I/O on hot path**: blocking file/network calls in request handlers, render functions, or signal effects
  • **Blocking call while holding a lock**: remote/IO/`sleep` inside a `synchronized`/`Lock` block serializes every caller behind one round-trip → contention, thread starvation. Hoist the call out of the critical section (cache or pre-fetch the value).
  • **Exception as control flow in a hot loop**: throwing+catching (e.g. `NoSuchMethodException`, parse failures) on each iteration as normal flow → repeated stack-fill/allocation cost. Use a non-throwing check, or cache hits *and* misses.

Framework-specific (auto-detect from Project Profile)

Angular / signals

  • Computed/effect reading signals it doesn't depend on (overzealous re-execution)
  • Functions called from templates without `@let` or memoization (re-runs every CD cycle)
  • Subscriptions without `takeUntilDestroyed` / `async` pipe / `DestroyRef` (memory leak)
  • `Object.keys`/`array.filter` inline in templates instead of `computed()`
  • Missing `trackBy` on `@for` loops over large lists
  • `ChangeDetectionStrategy.Default` reintroduced where parent uses `OnPush`

React

  • Missing `useMemo` / `useCallback` for non-primitive props passed to memoized children
  • New object/array literals in deps arrays
  • Effects without cleanup that subscribe / set timers

Backend (any)

  • Database calls without indexes on queried columns (check migrations)
  • Unbounded `findAll()` / `SELECT *` on large tables
  • Missing pagination on list endpoints
  • **Async-path initialization gap**: an accelerator (native/loadable extension, connection-pool warmup, prepared-statement or index cache) initialized on the SYNC connection/code path but skipped on the ASYNC one → silent fallback to a far slower default (e.g. an in-process scan instead of an indexed/native lookup), correct but orders-of-magnitude slower. Flag the async path that omits the init its sync sibling performs.

Memory & resources

  • Subscriptions, listeners, timers, intervals without teardown
  • Caches without size bounds or TTL
  • Closures capturing large objects unnecessarily

Bundle size (frontend only)

  • New imports of large libraries (lodash whole-package, moment.js, full icon set) — flag smaller alternative
  • Server-only modules accidentally imported into client bundles
  • Lazy-loadable routes loaded eagerly

Severity calibration

  • 🔴 Critical: clear memory leak, unbounded growth, N+1 on hot path
  • 🟠 Important: missing memoization on expensive compute, missing trackBy on big lists, sync I/O on render
  • 🔵 Suggested: micro-optimizations only when measurable (count saved operations or cite benchmark)

Don't flag micro-optimizations on cold paths.

Return format

List of findings, each with: `file:line`, severity, evidence, performance category (N+1 / memo / leak / bundle / etc.), measured or estimated cost, concrete fix, root-cause key, confidence level.

Read more
Ships withreview-all

Project-agnostic code review for Claude Code. One slash command runs deterministic gates, ten parallel review agents, and an adversarial verification pass.

Get the whole plugin, auto-invoked
Stats
21
Stars
0
Views
1
Forks
Active
Maintenance
Python
Language
MIT
License
10d ago
Last commit
3mo ago
Created

Repo: ncoevoet/claude-review-all