Skip to content
Back to skills

Performance Profiling

ASecurity

Find and fix a performance problem by measuring first, with a defined metric and budget, a reproducible benchmark, a profile, one change at a time and numbers before and after. Use for "this is slow", "speed up", "reduce memory use", "profile this", "why does the page take so long".

  • 11 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
ai-agentsrustgodatabaseperformance

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add kinzarra/vibetrack --skill performance-profiling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Performance Profiling?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Performance Profiling
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kinzarra-performance-profiling/badge)](https://www.skillsdirectory.com/skills/kinzarra-performance-profiling)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: performance-profiling
description: Find and fix a performance problem by measuring first, with a defined metric and budget, a reproducible benchmark, a profile, one change at a time and numbers before and after. Use for "this is slow", "speed up", "reduce memory use", "profile this", "why does the page take so long".
---

# Performance profiling

The result is a measured improvement on a named metric, with the benchmark that anyone can rerun, or a measured statement that the suspected code is not the problem.

## 1. Define the metric and the budget

- Name one primary metric that a user or an operator feels: response time of an operation, page load to usable, throughput, peak memory, start-up time, build time, cost per request.
- Name the scenario: which operation, with which input size and data volume, how many at once, cold or warm.
- Set the budget as a number with a percentile: "the list endpoint answers within 300 ms at the 95th percentile with 10,000 records". Take it from the task. If the task has none, propose one and mark it as an assumption.
- Name the guard metrics that must not get worse: correctness, memory when optimizing time, tail latency when optimizing the average.

## 2. Reproduce and take a baseline

- Build a repeatable measurement: a benchmark, a script or a load run in the worktree, with fixed input and realistic data volume. Ten rows hide what ten thousand show.
- Use a build as close to production as possible: optimizations on, debug tooling and verbose logging off.
- Warm up, then run at least 10 repetitions (more for fast operations). Record the median, the 95th percentile and the spread. If the spread is over about 10 percent, reduce the noise (close other load, pin the input, more runs) before trusting any comparison.
- Record the environment: machine, runtime version, data size, command. Save the benchmark; it is part of the result.
- If the slowness does not show up locally, stop guessing. Report what was measured and which data from the real system is needed: timings, traces, slow query logs, the size of the real data.

## 3. Profile to find the real bottleneck

- Split the total first: time in the project's own code, in the database, in network calls, in rendering, in waiting. Use the timings and tracing the project already has, then a profiler for the largest part.
- Use the right tool for the resource: a sampling profiler for processor time, an allocation profiler for memory, query plans and query counts for the database, the network waterfall and main-thread profile in the browser.
- Read the profile top down. Find the few places that hold most of the cost. A place under about 5 percent of the total is not worth changing now.
- Look for the usual causes in order of frequency: the same query or request repeated in a loop; missing index or a full scan; loading far more data than is used; work repeated that could be done once; quadratic loops over growing data; blocking calls in sequence that could be concurrent; serialization and copying of large objects; missing caching of stable results; oversized payloads and assets; lock contention.
- State the hypothesis with the expected gain: "the 120 queries per request take 70 percent of the time; one joined query should bring 800 ms down to about 250 ms".

## 4. Fix one thing, measure again

- Make one change. Rerun the same benchmark under the same conditions. Keep the change only when the gain is larger than the noise.
- If the gain is absent or within the noise, undo the change, even when the new code looks faster.
- Prefer, in order: doing less work, doing it once, doing it in bulk, a better algorithm or data structure, an index, concurrency, caching. Caching comes last because it adds invalidation, staleness and memory to manage; state the invalidation rule and the size bound when adding one.
- Check correctness after each change: the project's tests pass and the output is identical for the benchmark input.
- Check the guard metrics and the other sizes: small input, large input, concurrent callers.
- Stop when the budget is met. Further gains are listed as options with their estimated effect, not implemented.

## 5. Keep it from coming back

- Where the project has a place for it, leave the benchmark or add a cheap test of the cause: a query-count assertion, a size limit, a complexity check. Avoid tests on wall-clock time; they are flaky.
- Note the readability cost of the change, and comment the reason next to any non-obvious code.

## 6. Report

1. **Metric, scenario and budget**, and whether the budget is met.
2. **Numbers**: a table of before and after for the primary and guard metrics (median, 95th percentile, runs, spread), with the environment and the exact command.
3. **Bottleneck**: where the cost was (file:line, query, request), with its share from the profile.
4. **Change made** and why this one.
5. **Tried and reverted**: changes that did not help, with their numbers.
6. **Remaining options**, each with the estimated gain and cost.
7. **Not measured**: what differs from production and may change the picture.

Rules: no optimization without a baseline number. Never load-test or profile a shared or production system from the worktree unless the task says so. Do not commit, push or deploy unless the task says so. Benchmark data contains no real personal data or secrets. When blocked, state exactly which measurement or access is needed.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.