perf-measurement
Performance Measurement Methodology
Use this skill to make server/hot-path performance work empirical instead of speculative: pick a metric that survives noise, isolate the cost with controls and profiling, attribute it to the right layer, change one thing, and re-measure. The recurring failure mode this skill prevents is plausible-but-wrong optimization — a change that "should" help (smaller capture, faster allocator, fewer copies) but moves nothing, or a change credited by a contaminated benchmark.
The governing rule: measure, do not guess; isolate, do not assume; change one thing, then re-measure. A truthful "this did not help, and here is the number that proves it" is a successful outcome, not a failure.
WORKFLOW SKILL. INVOKES: terminal (build, run servers, load generators, profilers, allocation counters) and read-only file access. This skill decides what to measure and whether a change worked; route the source-level transformation itself, and stack-specific framework mechanics, to the relevant language/library review. FOR SINGLE OPERATIONS: use to choose a metric, design a control experiment, or sanity-check a benchmark result.
Scope
- Use this skill for: choosing the right performance metric for a given change size; designing control experiments that isolate one layer's cost (e.g. a "no-serialization" or "no-parse" reference server); profiling under load and attributing cost to buckets; validating that an optimization actually moved the metric; and recognizing when a result is contaminated or a proposed fix is a known no-op.
- Apply it to: per-connection/per-request server hot paths, allocation-reduction work, serialization/parsing cost, concurrency scaling questions, and "is X faster than Y" comparisons.
- Keep findings tied to a number from a reproducible procedure. Every claim ("+9%", "−4 allocs/request", "now matches the baseline") names the metric, the tool, and the conditions.
DO NOT USE FOR:
- The source-level transformation itself (unnecessary copy, missing
reserve,std::functioncapture cost) — that is C++ source-level performance review. This skill decides what to measure and whether it worked; the source-level review decides what to change. - Framework-specific behavior mechanics (Beast serializer/parser internals, Asio executor/strand semantics) — a networking-library concern.
- Correctness, lifetime, or concurrency-safety review of an optimization — an object-lifetime / concurrency review concern. A faster-but-wrong change is out of scope here; name the dependency when a finding rests on it.