Perf

The general profile-driven perf loop for any language or runtime: baseline, profile, fix the real hot path, re-measure. Use for /perf, "this is slow", or optimization work.

outthislife 0f11031 1.1 KB Updated

File contents

Perf

The general performance loop. Profiling (CPU profile, flamegraph, memory snapshot, trace) is the usual tool, but the loop is the same regardless of which one fits.

Loop

  1. Reproduce the slow path and capture a baseline number — time, memory, FPS, request latency, whatever matters here.
  2. Profile to find the real hot path: CPU profile / flamegraph / memory snapshot / trace as fits. Reuse the repo's existing profiler; don't build a parallel harness.
  3. Read the profile, not your intuition — fix the actual hot path.
  4. Re-measure. Record before/after in the PR title/description.
  5. Ship in topical commits (pr-update), clean, keep CI green.

Don't

  • Optimize by guess before profiling.
  • Fiddle with the measurement system instead of improving perf.
  • Run a full suite or profile that overwhelms the machine — scope the run.
  • Report gains you didn't measure.

outthislife/brooklyn-skills/tree/main/skills/perf commit 0f110310ff

Frequently asked questions

npx skillmds@latest add outthislife/perf