soothfast-measure API reference#
Generated by
cargo soothfast docs referenceMeasurements and verified claims come from the latest baseline; CI gates them.
soothfast_measure#
CountingAllocator struct#
pub struct CountingAllocator
main function#
pub fn main()
soothfast_measure::alloc#
AllocMeasurement struct#
pub struct AllocMeasurement
Per-iteration allocation counts for one item.
measure function#
pub fn measure(runner: impl Fn(&mut Bencher)) -> AllocMeasurement
Measure one workload iteration's allocations: warm once (lazy statics, allocator pools), then take the minimum over a few single-iteration runs.
soothfast_measure::asyncexec#
AsyncMeasurement struct#
pub struct AsyncMeasurement
Per-iteration async behavior for one item.
measure function#
pub fn measure(runner: impl Fn(&mut Bencher)) -> AsyncMeasurement
Warm once, then min-of-3 single iterations (same shape as the alloc backend — counts, not times, so min is exact).
soothfast_measure::callgrind#
annotate function#
pub fn annotate(id: &str) -> Result<String, String>
Human triage report: top self-cost functions for one item's workload.
measure function#
pub fn measure(id: &str) -> Result<u64, String>
Per-iteration Ir for one item.
measure_all function#
pub fn measure_all(ids: &[&str]) -> Vec<Result<u64, String>>
Per-iteration Ir for many items, measured concurrently (Ir counts are timing-independent). Results come back in input order.
probe function#
pub fn probe() -> Result<(), String>
Can valgrind actually run THIS binary? valgrind --version is not
enough: an AVX-512-compiled glibc loader SIGILLs before main().
soothfast_measure::perfcnt#
PerfMeasurement struct#
pub struct PerfMeasurement
Per-iteration counter values for one item.
measure function#
pub fn measure(runner: impl Fn(&mut Bencher)) -> PerfMeasurement
Measure per-iteration instructions/cycles/cache-refs (min of 3 rounds).
measure_instructions function#
pub fn measure_instructions(runner: impl Fn(&mut Bencher)) -> u64
Instructions-only measurement, for complexity sweeps.
probe function#
pub fn probe() -> Result<(), String>
Can this environment open an instructions counter on itself?
soothfast_measure::stats#
Summary struct#
pub struct Summary
Robust summary of one sample set.
summarize function#
pub fn summarize(values: &mut [f64]) -> Summary
Summarize a non-empty sample set. Sorts in place.
soothfast_measure::sweep#
DRIFT_LIMIT constant#
pub const DRIFT_LIMIT: f64 = 2.5
Growth beyond the claim must stay under this factor across the sweep. 2.5x tolerates n vs n log n ambiguity (~1.4x over a 16x size range) while catching n -> n^2 (16x) the day it happens.
SweepOutcome struct#
pub struct SweepOutcome
Verdict of one complexity sweep: how far measured growth strayed from
the claimed class, and whether it stayed within [DRIFT_LIMIT].
class_value function#
pub fn class_value(class: &str, n: f64) -> f64
Cost model for a claimed class at size n.
evaluate function#
pub fn evaluate(class: &str, sizes: &[usize], values: &[f64]) -> SweepOutcome
Evaluate measured values (one per size, same order) against a claim.
soothfast_measure::walltime#
DEFAULT_SAMPLES constant#
pub const DEFAULT_SAMPLES: u32 = 31
Default sample count; odd so the median is a real observation.
WallMeasurement struct#
pub struct WallMeasurement
Wall-clock summary for one item, in ns per iteration.
calibrate function#
pub fn calibrate(samples: u32) -> f64
A/A noise calibration: measure an identical reference workload against itself repeatedly; the worst relative disagreement between medians is the environment's observed noise floor (percent). Gates wider than this floor are meaningful; gates inside it are coin flips.
measure function#
pub fn measure(runner: impl Fn(&mut Bencher), samples: u32) -> WallMeasurement
Measure one item: pilot run to pick iters, then samples timed loops.