Skip to content
Researched developer tool comparisonsPrices dated · vendor sources linked · no star ratings
Search

Stage 04 · Run · Researched comparison

Best Rust Benchmarking Libraries in 2026

Criterion.rs is the first pick for most teams that need statistical benchmarks with plots and regression detection, and it suits library authors who want a stable, widely used harness. Divan is a lighter alternative for fast, low-overhead benchmarks with a simple attribute API. Gungraun (formerly iai-callgrind) is the choice when you need instruction counts and cache data from Valgrind rather than wall-clock timing.

By
Published 28 Nov 2026 · 6 tools compared

We run no ads and no affiliate links at launch. The order of a list follows our published method. See how we score.

Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.

Key takeaways

  • Criterion.rs, Divan and Gungraun are free and open source; CodSpeed is a hosted CI service with a free tier and paid plans.
  • Wall-clock benchmarks are noisy on shared CI runners; Gungraun measures instruction counts, which are more stable across machines.
  • The built-in `#[bench]` attribute only works on nightly Rust and is not stable.
  • hyperfine benchmarks whole binaries and command lines, not individual functions inside a Rust crate.

Who each pick is for

  • Library authors who want statistical benchmarks with plots and regression checksCriterion.rs
  • Developers who want fast, simple benchmarks with a low-overhead APIDivan
  • Teams that need stable instruction counts and cache data in CIGungraun (formerly iai-callgrind)
  • Quick benchmarks in nightly-only projects with no extra dependenciesBuilt-in #[bench] (nightly Rust)
  • Measuring whole-binary and command-line performance with warmup and statisticshyperfine
  • Teams that want hosted benchmark tracking and regression checks in CICodSpeed

Comparison

The 6 tools at a glance
ToolBest forStandout featureListed starting priceFree plan or trial
1Criterion.rsLibrary authors who want statistical benchmarks with plots and regression checksStatistical analysis with confidence intervalsFree (open source)Free plan
2DivanDevelopers who want fast, simple benchmarks with a low-overhead APISimple `#[bench]` attribute APIFree (open source)Free plan
3Gungraun (formerly iai-callgrind)Teams that need stable instruction counts and cache data in CIInstruction counts are stable across machinesFree (open source)Free plan
4Built-in #[bench] (nightly Rust)Quick benchmarks in nightly-only projects with no extra dependenciesNo external crate neededFree (open source)Free plan
5hyperfineMeasuring whole-binary and command-line performance with warmup and statisticsWorks with any executable, not just RustFree (open source)Free plan
6CodSpeedTeams that want hosted benchmark tracking and regression checks in CITracks benchmark history across commitsSee vendor pricing pageFree plan

How we picked

We picked tools that genuinely benchmark Rust code or Rust binaries and are currently maintained. Criteria were fit for the job (function-level timing, instruction counts, whole-binary timing or hosted tracking), platform support, licence and price, and the main limits that affect real use. Sources are vendor pages, official documentation and project repositories. Prices and plan limits change, so confirm them on the vendor site before you commit.

The tools, one by one

01

Criterion.rs

Best for library authors who want statistical benchmarks with plots and regression checks

Visit github.com
Criterion.rs homepage
Criterion.rs homepage, captured Nov 2026

What it is and where it fits

Criterion.rs is the most widely used benchmarking harness for Rust libraries. You write benchmark functions in a `benches/` directory, and it runs each one many times, applies statistical analysis and reports confidence intervals. It can save baselines and compare later runs against them, which helps catch performance regressions in CI.

It produces HTML reports with plots and supports throughput measurement, so you can report work per second. It runs on stable Rust on Linux, macOS and Windows. The tradeoffs are compile time and run time: statistical runs take longer than a single timing loop, and benchmarks that need many samples can slow a CI job. It is the right default for published crates and teams that want detailed reports. Skip it if you need very fast feedback on every commit or instruction-level counts.

Standout: Statistical analysis with confidence intervals

Pricing pointer

Free (open source), as listed by the vendor (Criterion.rs website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Statistical analysis with confidence intervals
  • HTML reports and baseline comparison

Drawbacks

  • Longer compile and run times
  • heavier setup than attribute-based harnesses

Skip it if this limit matters to you: longer compile and run times.

Verdict. A sensible pick for library authors who want statistical benchmarks with plots and regression checks.

Alternatives in this guide: Divan, Gungraun (formerly iai-callgrind), Built-in #[bench] (nightly Rust)

02

Divan

Best for developers who want fast, simple benchmarks with a low-overhead API

Visit github.com
Divan homepage
Divan homepage, captured Nov 2026

What it is and where it fits

Divan is a benchmarking library built around a single attribute. You annotate a function with `#[bench]`, and Divan handles setup, timing and reporting. It focuses on low overhead and fast runs, so it fits tight feedback loops and large benchmark suites where Criterion.rs would take too long.

It supports benchmarking generic functions over multiple argument sets, and it can report throughput and allocation counts. It runs on stable Rust across the major desktop platforms. The reporting is more compact than Criterion.rs, and it does not aim to replace a full statistical framework with saved baselines and plots. Choose Divan when you want quick, readable benchmarks and do not need detailed regression reports. Choose Criterion.rs when you do.

Standout: Simple `#[bench]` attribute API

Pricing pointer

Free (open source), as listed by the vendor (Divan website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Simple `#[bench]` attribute API
  • low measurement overhead and fast runs

Drawbacks

  • Fewer statistical reporting features than Criterion.rs
  • smaller ecosystem

Skip it if this limit matters to you: fewer statistical reporting features than Criterion.rs.

Verdict. A sensible pick for developers who want fast, simple benchmarks with a low-overhead API.

Alternatives in this guide: Criterion.rs, Gungraun (formerly iai-callgrind), Built-in #[bench] (nightly Rust)

03

Gungraun (formerly iai-callgrind)

Best for teams that need stable instruction counts and cache data in CI

Visit github.com
Gungraun (formerly iai-callgrind) homepage
Gungraun (formerly iai-callgrind) homepage, captured Nov 2026

What it is and where it fits

Gungraun, formerly known as iai-callgrind, measures benchmarks with Valgrind's Callgrind tool instead of the system clock. That means it reports instruction counts, cache hits and misses, and branch prediction data. Instruction counts change far less between machines than wall-clock time, which makes this harness useful on shared CI runners where timing is noisy.

The cost is platform support: Valgrind runs on Linux, so Gungraun benchmarks are Linux-only. Runs are also slower than native execution because of Valgrind instrumentation. It integrates with Criterion-style benchmark definitions and can fail a CI job when instruction counts exceed a threshold. Use it when timing noise is a real problem or when you care about low-level cost. Skip it if you need to benchmark on macOS or Windows, or if wall-clock time is what your users experience.

Standout: Instruction counts are stable across machines

Pricing pointer

Free (open source), as listed by the vendor (Gungraun (formerly iai-callgrind) website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Instruction counts are stable across machines
  • reports cache and branch data

Drawbacks

  • Requires Valgrind, so Linux only
  • slower runs than native timing

Skip it if this limit matters to you: requires Valgrind, so Linux only.

Verdict. A sensible pick for teams that need stable instruction counts and cache data in CI.

Alternatives in this guide: Criterion.rs, Divan, Built-in #[bench] (nightly Rust)

04

Built-in #[bench] (nightly Rust)

Best for quick benchmarks in nightly-only projects with no extra dependencies

Visit doc.rust-lang.org
BIBuilt-in #[bench] (nightly Rust)doc.rust-lang.org
Homepage screenshot not available; visit the vendor site.

What it is and where it fits

Rust's standard test harness includes a `#[bench]` attribute that runs a function repeatedly and reports nanoseconds per iteration. It ships with the toolchain, so there is nothing to add to `Cargo.toml`, and you run benchmarks with `cargo bench`. The catch is that the feature is unstable: it only works on nightly Rust, and the interface can change.

The output is basic. You get a mean time per iteration, not confidence intervals, plots or baseline comparison. There is no built-in regression detection. For small projects or quick checks on nightly, that is often enough. For anything you plan to track over time, a dedicated harness gives you more. Many teams use the built-in harness for early exploration and move to Criterion.rs or Divan once benchmarks need to be maintained.

Standout: No external crate needed

Pricing pointer

Free (open source), as listed by the vendor ([Built-in #[bench] (nightly Rust) website](https://doc.rust-lang.org/unstable-book/library-features/test.html)). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • No external crate needed
  • integrated with `cargo test`

Drawbacks

  • Nightly-only and unstable
  • minimal statistics and reporting

Skip it if this limit matters to you: nightly-only and unstable.

Verdict. A sensible pick for quick benchmarks in nightly-only projects with no extra dependencies.

Alternatives in this guide: Criterion.rs, Divan, Gungraun (formerly iai-callgrind)

05

hyperfine

Best for measuring whole-binary and command-line performance with warmup and statistics

Visit github.com
hyperfine homepage
hyperfine homepage, captured Nov 2026

What it is and where it fits

hyperfine is a command-line benchmarking tool, not a Rust library. You give it a shell command, and it runs it multiple times with warmup, then reports mean, standard deviation, min and max. It can compare several commands and export results to JSON, CSV or Markdown. It is written in Rust and installs through Cargo or common package managers.

Use it when the thing you care about is the program as users run it: CLI startup time, end-to-end throughput or the effect of a compiler flag. It cannot time a single function, and process startup is part of every measurement, so it complements rather than replaces a microbenchmark harness. A common setup is Criterion.rs or Divan for functions and hyperfine for the built binary.

Standout: Works with any executable, not just Rust

Pricing pointer

Free (open source), as listed by the vendor (hyperfine website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Works with any executable, not just Rust
  • statistical summary and export formats

Drawbacks

  • Does not benchmark functions inside a crate
  • process startup is included in timing

Skip it if this limit matters to you: does not benchmark functions inside a crate.

Verdict. A sensible pick for measuring whole-binary and command-line performance with warmup and statistics.

Alternatives in this guide: Criterion.rs, Divan, Gungraun (formerly iai-callgrind)

06

CodSpeed

Best for teams that want hosted benchmark tracking and regression checks in CI

Visit codspeed.io
CodSpeed homepage
CodSpeed homepage, captured Nov 2026

What it is and where it fits

CodSpeed is a hosted service that runs or ingests your benchmarks and tracks results over time. It integrates with Criterion.rs, Divan and other harnesses, and it reports performance changes per commit and pull request. It can run benchmarks in a controlled environment or use instruction-count style measurement to reduce noise.

Because it is a service, benchmark code and results are sent to CodSpeed's infrastructure. Check your organization's rules before sending proprietary code or data. The free plan exists but has limits; paid tiers are listed on the vendor pricing page. It suits teams that want a dashboard and PR comments without building their own tracking. Skip it if you need everything to stay on your own runners.

Standout: Tracks benchmark history across commits

Pricing pointer

See vendor pricing page, as listed by the vendor (CodSpeed website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Tracks benchmark history across commits
  • integrates with CI providers

Drawbacks

  • Hosted service, so results leave your CI
  • free tier has usage limits

Skip it if this limit matters to you: hosted service, so results leave your CI.

Verdict. A sensible pick for teams that want hosted benchmark tracking and regression checks in CI.

Alternatives in this guide: Criterion.rs, Divan, Gungraun (formerly iai-callgrind)

Who should use what

If you maintain a published crate and want regression reports, start with Criterion.rs. If you want fast, simple benchmarks with minimal setup, use Divan. If CI timing is noisy and you need stable instruction counts on Linux, use Gungraun. If you care about the shipped binary or CLI startup, use hyperfine alongside a function-level harness. Teams that want a hosted dashboard and PR-level regression checks should look at CodSpeed and confirm its free-tier limits first.

Questions to settle before you buy

What to check before you buy

  • Confirm the harness runs on stable Rust if your project cannot use nightly.
  • Check platform support: Gungraun needs Valgrind and is Linux-only.
  • Decide whether you need wall-clock time, instruction counts or both.
  • Plan how benchmarks run in CI and whether shared runners will add noise.
  • For hosted services, confirm what code and results leave your infrastructure.

FAQ

Is Criterion.rs still maintained?

Yes. Criterion.rs is an active open-source project with a public repository. Check the repository for the latest release and open issues before adopting it, and confirm that its supported Rust version matches your toolchain.

Can I benchmark Rust on stable without nightly?

Yes. Criterion.rs, Divan and Gungraun all work on stable Rust. The built-in `#[bench]` attribute requires nightly, so avoid it if your project is pinned to stable.

What is the difference between Gungraun and iai-callgrind?

Gungraun is the current name of the project formerly called iai-callgrind. The repository URL is unchanged. If you see older guides referring to iai-callgrind, they describe the same Valgrind-based instruction-count harness.

Does hyperfine replace a Rust benchmarking library?

No. hyperfine times whole commands, including process startup, and cannot measure a single function inside your crate. Use it for binaries and CLI performance, and use Criterion.rs, Divan or Gungraun for function-level benchmarks.

Is CodSpeed free?

CodSpeed has a free plan with usage limits and paid plans. Exact limits and prices are on the vendor pricing page. Because it is a hosted service, review what benchmark data is sent to it before enabling it on private repositories.

Sources we checked

Method: how we score · editorial policy.

  1. Criterion.rs (official site)
  2. Divan (official site)
  3. Gungraun (formerly iai-callgrind) (official site)
  4. Built-in #[bench] (nightly Rust) (official site)
  5. hyperfine (official site)
  6. CodSpeed (official site)

Change log. First published 28 Nov 2026.