- Choose a stable benchmark and preserve its identity and workload. Before you freeze it, prove that it can see the problem: a known slowdown must move the result.
- Record a statistically useful baseline. Set a target and a minimum number of rounds. Do not stop before that minimum unless you reach the target.
- Profile the hot path before editing.
- Implement one bounded optimization.
- Re-run the same benchmark and correctness checks.
- Keep the change only when the improvement is reproducible and no contract regresses.
- Use a new benchmark identifier for a materially different workload.
- Run
review.
Do not report performance gains from debug builds or incomparable fixtures.