Run Correctness Before Timing

PERF-RUN-CORRECTNESS-FIRST

Summary

Run relevant correctness checks before interpreting performance timing. Fast code that changes behavior invalidates the benchmark claim and wastes review effort.

Rule

Run correctness before performance timing.

Why

Fast wrong code is still wrong, and correctness failures can invalidate timing data. Running correctness checks first prevents time spent interpreting benchmarks from an implementation that does not preserve the behavior under test.

Helps

  • Keeps performance work grounded in behavior preservation before speed claims.

Limits

During exploratory profiling, partial correctness may be enough to locate a hotspot. Before landing, run the relevant correctness checks and report any gaps.

Agent Instruction

Run correctness before performance timing because fast wrong code is still wrong, and correctness
failures can invalidate timing data.

Mechanisms

Supported by tests before benchmarks, regression tests for optimized paths, invariant checks, and PR validation that separates correctness evidence from timing evidence.

References