agentleFS
Smaui94Smaui94/ClaudeSkillCollection/performance-review/SKILL.md

performance-review

Skill0 starsChanged 9 days agoMITView on GitHub

Review code for real performance problems - avoidable work in loops (repeated I/O, queries, regex compilation, allocations), wrong data structures, quadratic algorithms on growing input, string concatenation in loops, loading everything into memory instead of streaming, missing caching, memory leaks and heavy work in hot paths like game loops or render functions - always related to realistic input sizes, with a recommendation to measure before changing anything. Use when asked to check/review performance, speed, slowness, memory usage, efficiency or "why is this slow", in any language.

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ci-cd-pipeline, security-review and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • nanvixSkill

    ci-cd-pipeline

    Guide for Nanvix CI and GitHub Actions workflow behavior, including local pipeline execution and matrix coverage. Use this when asked about CI checks, workflow failures, or release flow.

    Also in 3 projects that use this

  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    Also in 9 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 3 projects that use this

  • OpenAISkill

    systematic-debugging

    Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 22 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the files/directories the user names, otherwise the code paths the user calls slow, otherwise the main code paths (request handlers, …

    line 11
  2. Distinctive:

    Ask yourself (or the user, if it isn't visible) what the realistic sizes are: number of records, request rate, frame budget (16.7 ms at 60 …

    line 14
  3. Very specific:

    Check PF1-PF12. Database query issues → sql-review (SQ4, SQ5, SQ8, SQ9).

    line 17
  4. Distinctive:

    Every finding has a concrete location and a scaling estimate with the assumed input size.

    line 55
  5. Distinctive:

    Do not change code. Optimize only when the user explicitly asks for it.

    line 57

“Common” is measured: kept by at least 6 in 10 of the 22 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Performance review

Review only: report findings, never optimize code unless the user explicitly asks. Measure before changing: every finding must say how it scales with realistic input, and the report recommends a profiler to confirm. No micro-optimizations without evidence.

Scope

Check the files/directories the user names, otherwise the code paths the user calls slow, otherwise the main code paths (request handlers, loops over data, game loops, rendering). Skip .git/, build output, vendor/, node_modules/, .venv/, generated code, tests and one-off scripts.

Steps

  1. Ask yourself (or the user, if it isn't visible) what the realistic sizes are: number of records, request rate, frame budget (16.7 ms at 60 FPS). Without numbers, state your assumption.
  2. Find the hot paths: loops over collections, per-request/per-frame code (_process, _physics_process, Update, render, useEffect, paint), recursive functions, batch jobs.
  3. Estimate complexity for each finding (e.g. "O(n·m), n = orders ≈ 10,000, m = customers ≈ 5,000 → 5·10⁷ comparisons per request").
  4. Check PF1-PF12. Database query issues → sql-review (SQ4, SQ5, SQ8, SQ9).
  5. Report (format below) with the matching profiler.

Rules

  • PF1 error: repeated I/O inside a loop (file reads, HTTP calls, database queries → sql-review SQ4) that could be done once or batched
  • PF2 warning: wrong data structure - lookups in a list/array inside a loop instead of a set/map; list.contains/in list on large lists; removing from the front of an array list
  • PF3 error: quadratic or worse algorithm on input that grows (nested loops over the same or two large collections, repeated sorting, indexOf in a loop)
  • PF4 warning: string concatenation in a loop (Java/C# += on strings, Python += in big loops) instead of a builder/join
  • PF5 warning: loading everything into memory (whole file, whole table, all pages) where streaming or pagination is possible
  • PF6 warning: expensive pure work repeated with the same input (regex compilation, parsing, reflection, JSON.parse of the same string) - candidate for caching or hoisting out of the loop
  • PF7 error: memory leak - listeners/signals/subscriptions never removed, caches/static collections that only grow, unclosed resources, timers not cleared
  • PF8 error: heavy work in a hot path: allocations, find/get_node lookups, GetComponent, loading resources, logging in every frame or every request
  • PF9 warning: unnecessary work - computing values that are never used, re-rendering whole lists on every change, missing early exit
  • PF10 warning: blocking the main/UI/event-loop thread with long work → also concurrency-review CC8
  • PF11 info: inefficient but bounded (small, fixed-size input) - mention only if it is in a very hot path
  • PF12 info: premature optimization that hurts readability without measured benefit (report it too - readability is a cost)

Profilers (recommend the matching one)

StackProfiler
PythoncProfile + snakeviz, py-spy, scalene, memray (memory)
Java / KotlinJava Flight Recorder + JMC, async-profiler, VisualVM, JMH (micro-benchmarks)
C#dotnet-trace, dotnet-counters, Visual Studio profiler, BenchmarkDotNet
JS / TSbrowser DevTools Performance/Memory tab, node --prof, clinic.js
C / C++perf, Visual Studio profiler, VTune, Valgrind callgrind/massif, Tracy
Gopprof (go test -bench . -cpuprofile), go tool trace
Godotbuilt-in Profiler and Monitors (Debugger panel)
UnityUnity Profiler, Memory Profiler, Frame Debugger
SQLEXPLAIN / EXPLAIN ANALYZE (ask before running on real data)

False positives to drop

Code that runs once at startup or on tiny bounded input · loops where the compiler/runtime already optimizes the pattern (e.g. string + of constants) · readability-first code in non-hot paths · caching where the data changes often (stale data is a bug).

Report

In the user's language, hotspots ranked by expected impact:

path/to/file:line - error|warning|info - <ID> <rule> - <what is slow and how it scales, e.g. "O(n²): 10,000 items → 10⁸ steps per call"> - direction: <what should change, e.g. "look up by key instead of scanning"> - confirm with: <profiler>
  • Every finding has a concrete location and a scaling estimate with the assumed input size. Mark estimates as "approx." and unconfirmed hot paths as "possible".
  • End with a summary: assumed input sizes, findings per severity, the profiler to use first, then the 3 changes with the biggest expected effect.
  • Do not change code. Optimize only when the user explicitly asks for it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.