subms 0.2.1

Zero-dependency perf-test harness for Rust: timed stages, percentiles, and a stable JSON shape consumed by the submillisecond.com cookbook. Includes a `Recipe` trait for cookbook benchmarks.
Documentation
  • Coverage
  • 80%
    24 out of 30 items documented1 out of 24 items with examples
  • Size
  • Source code size: 31.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 509.96 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 23s Average build duration of successful builds.
  • all releases: 30s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kdog007

subms

A tiny, std-only perf-test harness for Rust programs. Records timed samples per stage, computes percentiles, and emits a stable JSON shape suitable for upload to submillisecond.com cookbook samples.

Zero external dependencies.

v0.1.0 — early development. The API is not yet stable.

Quick start

use subms::PerfHarness;

let mut h = PerfHarness::new("lsm-tree", "rust");
h.input("entries", &50_000.to_string());
h.input("bloom_mode", "on");
h.meta("sstables", "46");

let put = h.stage("put", 50_000);
for _ in 0..50_000 {
    put.time(|| { /* work under test */ });
}

h.write_json(&mut std::io::stdout()).unwrap();

Output shape

Stable JSON, matching the companion Java harness in the submillisecond.com cookbook:

{
  "workload": "lsm-tree",
  "lang": "rust",
  "timestamp": "2026-05-13T20:24:38Z",
  "inputs":  { "entries": "50000", "bloom_mode": "on" },
  "meta":    { "sstables": "46" },
  "stages": {
    "put": {
      "count": 50000,
      "p50_ns": 1234, "p99_ns": 9876, "p999_ns": 12345, "max_ns": 54321,
      "mean_ns": 2222,
      "samples_ns": [ ... downsampled to 500 evenly-spaced points ... ]
    }
  }
}

License

Dual-licensed under either of MIT or Apache-2.0, at your option.