Expand description
Measurement backends.
Two tiers, deliberately separated:
- Deterministic (
instructions) — reproducible to ~0.02% run-to-run and ~0.035% across wildly different machine load. This is the only tier that may gate CI. - Timing (
wall_*) — recorded and charted, never gated. On a quiet 32-core host wall clock still shows 4–20% coefficient of variation; under contention the median moves ~150%.
Syscall counts and peak RSS sit awkwardly between the two: better than wall clock (~1%) but not deterministic, because they move with thread scheduling. They are recorded, and may be flagged, but must not gate at a tight threshold.
Structs§
- Counted
- Instruction counts from repeated cachegrind runs.
- Plan
- Quiet
- An observer that reports nothing.
- Sample
- One successful run of a subject’s timed command.
- Samples
- What one subject’s run produced.
- Slot
- One entry in a run’s sample order.
Traits§
- Observer
- Told about a run as it happens, to report progress.
Functions§
- instructions
- Instruction count via
valgrind --tool=cachegrind, repeated. - interleaved
- Measure several subjects against each other, interleaved.
- interleaved_
with_ versions interleaved, also returning each subject’s version.- schedule
- The order in which to take samples: every warmup round, then every timed round, each round a fresh shuffle of the subjects due in it.
- seed_
for - Derive a benchmark’s seed from the run’s, so
--bench x --seed ntakes the same order forxas the full run with--seed ndid. - stats
- Wall-clock statistics over a set of samples, in milliseconds.
- subject_
instructions instructionsfor a declared subject: its environment, itsok_exit_codes, and its prepare step before every cachegrind run, since each run has to start from the same state the timed samples did.- subject_
version - Run a subject’s
version_cmdonce and return the version it reports, orNonewhen the subject declares none. - valgrind_
available - Is cachegrind usable on this machine?
- wall
- Wall-clock statistics over
plan.runssamples of one command. - warnings
- Signs a subject’s samples should not be taken at face value, as
sentences for stderr.
samplesmust be in the order they were taken.
Type Aliases§
- Version
- A subject’s
version_cmdresult:Nonewhen it declares none or never got that far, otherwise what it printed or why it could not tell.