Skip to main content

Module measure

Module measure 

Source
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 n takes the same order for x as the full run with --seed n did.
stats
Wall-clock statistics over a set of samples, in milliseconds.
subject_instructions
instructions for a declared subject: its environment, its ok_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_cmd once and return the version it reports, or None when the subject declares none.
valgrind_available
Is cachegrind usable on this machine?
wall
Wall-clock statistics over plan.runs samples of one command.
warnings
Signs a subject’s samples should not be taken at face value, as sentences for stderr. samples must be in the order they were taken.

Type Aliases§

Version
A subject’s version_cmd result: None when it declares none or never got that far, otherwise what it printed or why it could not tell.