Skip to main content

Module bench

Module bench 

Source
Expand description

The kind-agnostic half of backend benchmarking stage 3 (speed): the environment a figure was taken in, timing statistics, the data file, and the comparison that never crosses machines. The kinds (persistant_kv::speed, persistant_blob::speed) own their workloads and how they are timed; they produce SpeedRows and nothing here knows what a key-value store or a blob store is.

  • Speed ranks only what passes the contract. A row is either Outcome::Measured or Outcome::Excluded with the leaf and reason; an excluded backend is listed, never ranked.
  • No constant rankings. Every row carries its Environment and the command that re-runs it; compare orders backends only within one environment.
  • Results are data files. SpeedTable reads and writes a tab-separated file.

Structs§

Comparison
One workload in one environment: the eligible backends fastest first by median, then the excluded ones. The environment is part of the answer.
Environment
Where and when a figure was measured. Keep every field honest: a row without its environment is a claim about the present.
Left
A backend that has no number for a workload, and why.
Position
One backend’s place in each of several workloads, side by side, in one environment. There is no combined score: how much each workload matters is the consumer’s call, so the places are shown and never summed.
Profile
Several workloads in one environment: each backend’s Position in all of them. The environment is part of the answer, as in Comparison.
Ranked
A backend that has a number for a workload.
SpeedParseError
Why a speed file did not parse.
SpeedRow
One recorded fact: a workload on a backend in an environment.
SpeedTable
A set of rows, read from and written to one tab-separated file.
Stats
Timing of one workload: nearest-rank percentiles of per-operation wall-clock time, in nanoseconds. The clock’s own resolution is coarser on some platforms; a figure near it means little.

Enums§

Outcome
A figure, or the reason there is none.

Functions§

compare
Group rows by workload and environment and order the measured ones. Rows from different machines never share a Comparison.
compare_across
Compare backends over several workloads at once, per environment. Environments with no number for any of them are left out. Built on compare: the places are its rankings, unchanged.
host_snapshot
What the host is doing right now, as cpu_load_pct:N,ram_available_mb:N (Windows: CPU load percent from WMI and free physical memory; Linux: the one-minute load average and MemAvailable), or unavailable when the OS gives neither. Costs a process launch on Windows, so call it outside any timed region. A benchmark records it at the start and end of a run: a figure taken while something else used the machine says so.