dev-bench 0.1.0

Performance measurement and regression detection for Rust. Part of the dev-* verification suite.
Documentation
  • Coverage
  • 100%
    19 out of 19 items documented1 out of 12 items with examples
  • Size
  • Source code size: 37.12 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 469.17 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 24s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • jamesgober/dev-bench
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jamesgober

What it does

Measures performance and produces verdicts the same way the rest of the dev-* suite does: machine-readable, stored as dev-report results.

Designed for AI agents and CI gating, not for interactive profiling. For interactive profiling, use criterion or divan.

Quick start

[dependencies]
dev-bench = "0.1"
use dev_bench::{Benchmark, Threshold};

let mut b = Benchmark::new("parse_query");
for _ in 0..1000 {
    b.iter(|| std::hint::black_box(40 + 2));
}

let result = b.finish();
let threshold = Threshold::regression_pct(10.0);

// If you have a stored baseline mean from a previous run, pass it in.
// Returns a CheckResult that can be pushed into a dev_report::Report.
let check = result.compare_against_baseline(None, threshold);

Design choices

  • Output is a CheckResult, not a stdout dump. Agents can read it.
  • Regression-first, not absolute-perf-first. The interesting question is "did this change make it slower," not "is this the fastest in the world."
  • Configurable thresholds: percent-based or absolute-nanosecond.

What's planned

  • Throughput measurements (ops/sec).
  • Allocation tracking via dhat integration (feature-gated).
  • Baseline storage formats (JSON files keyed by git SHA).
  • Comparison helpers that read baselines from disk.

The dev-* suite

dev-bench is one of the producer crates. See dev-tools for the umbrella crate and dev-report for the schema all results conform to.

License

Apache-2.0. See LICENSE.