Criterion.rs

Statistics-driven microbenchmarking for Rust that reliably detects performance changes.

Library
Cargo
v0.8.2
460 stars
Apache-2.0 OR MIT

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
59 /100 Fair
Development Activity 52
Maintenance 52
Community 56
Maturity 36
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
82 /100 Excellent
Architecture 84
Code Quality 82
Innovation 85
Learning Curve 78

Criterion.rs is a statistics-driven microbenchmarking library for Rust. It measures the performance of your code with statistical rigor, detecting and quantifying regressions and improvements even when they are small, so you can optimize with confidence.

Unlike a naive timing loop, Criterion.rs runs each benchmark many times, models the measurement noise, and reports confidence intervals along with a clear verdict on whether performance changed since the last run. It works on stable Rust and can render detailed HTML reports and gnuplot charts.

What You Get

  • A stable-Rust benchmark harness driven by criterion_group! and criterion_main! macros
  • Statistical change detection that reports whether performance improved, regressed, or stayed within noise
  • HTML reports and gnuplot charts visualizing distributions, regressions, and trends over time
  • Parameterized and grouped benchmarks via BenchmarkGroup for comparing implementations
  • Async benchmark support for Tokio, async-std, smol, and futures executors

Common Use Cases

  • Catching performance regressions in CI before they reach production
  • Comparing multiple implementations of a hot function to pick the fastest
  • Measuring the impact of an optimization with statistical confidence
  • Profiling parameterized workloads across a range of input sizes

Under The Hood

Architecture — Criterion.rs is structured around a sampling-and-analysis pipeline. Benchmarks are declared with the criterion_group!/criterion_main! macros (src/macros.rs), which build a runner that repeatedly invokes each routine (src/routine.rs, src/bencher.rs) to collect timing samples. Those samples flow through a statistics layer (src/stats, src/analysis, src/kde.rs, src/estimate.rs) that fits models, computes confidence intervals, and compares against saved baselines persisted on disk (src/fs.rs). Results are then emitted through pluggable reporters (src/report.rs, src/html, src/csv_report.rs) that produce console output, HTML pages, and gnuplot charts via the companion criterion-plot crate.

Tech Stack — Written in Rust (2021 edition, MSRV 1.86). Core dependencies include serde/serde_json/ciborium for serialization, clap for its runner CLI arguments, regex and walkdir for filtering and file management, tinytemplate for HTML report rendering, and oorandom/num-traits/cast for the statistics. Optional features add rayon for parallelism, csv output, and async executor bridges for tokio, smol, and futures.

Code Quality — The codebase is mature and modular, splitting statistics, measurement, reporting, and I/O into focused modules. It ships an integration test suite (tests/criterion_tests.rs) plus in-tree unit tests, and has 138 contributors with an actively maintained CHANGELOG. Naming is descriptive and the public surface is deliberately small relative to the internal machinery.

API Design — The developer-facing API is intentionally minimal: two macros plus Criterion, Bencher, and BenchmarkGroup. Getting started requires only a few lines in Cargo.toml and a benchmark file, and the extensive online book plus docs.rs reference lower the learning curve. The black_box helper and closure-based iter pattern keep benchmark authoring ergonomic while preventing the optimizer from eliding the measured work.

Used by 18 apps in this directory

Rust
65%
Apache 2.0

agentgateway

AI Development · Developer Tools · Mcp

5,071

An open source AI-native proxy that secures, observes, and governs agent-to-LLM, agent-to-tool, and agent-to-agent communication through MCP, A2A, and unified LLM routing.

View details
88
Repo Health
82
Technical
69
Dependency
Built with
Rust 65%
Go 23%
Updated 5 days ago
Rust
67%
MIT

Bun

Developer Tools

96,068

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
64
Dependency
Built with
Rust 67%
C++ 19%
TypeScript 10%
Updated 5 days ago
Rust
95%
MIT

claw-code

AI Agents · AI Code Assistants

195,291

A Rust-built CLI agent harness for Claude AI with persistent sessions, MCP tool integration, plugin hooks, and multi-provider support — designed to run autonomous coding workflows without human babysitting.

View details
51
Repo Health
71
Technical
77
Dependency
Built with
Rust 95%
Updated 1 months ago
Rust
52%
Apache 2.0

cocoindex

AI Development · Data Engineering

11,607

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 52%
Python 48%
Updated 4 days ago
Rust
99%
Other

Fluree DB

Databases

469

A temporal, verifiable graph database with git-like branching, integrated vector/text/geo search, and RDF/SPARQL/JSON-LD/openCypher support — benchmarked at 10.4x faster than the next database on the full Wikidata dump.

View details
87
Repo Health
74
Technical
65
Dependency
Built with
Rust 99%
Updated 5 days ago
Python
82%
Apache 2.0

headroom

AI Development · Developer Tools

73,966

Compress everything your AI agent reads — tool outputs, logs, RAG chunks, and files — before it reaches the LLM, achieving 60–95% fewer tokens with the same answers.

View details
85
Repo Health
86
Technical
69
Dependency
Built with
Python 82%
Rust 12%
Updated 5 days ago
Rust
73%
Other

iii

Developer Tools · Devops

18,814

Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 73%
TypeScript 16%
Updated 5 days ago
Rust
96%
Apache 2.0

InfluxDB

Analytics · Databases

31,758

Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.

View details
82
Repo Health
76
Technical
72
Dependency
Built with
Rust 96%
Updated 1 weeks ago
Rust
48%
MIT

Meetily

AI Assistants · Productivity

31,171

Privacy-first AI meeting assistant that transcribes and summarizes your meetings entirely on your local machine — no cloud, no data leakage.

View details
85
Repo Health
72
Technical
67
Dependency
Built with
Rust 48%
TypeScript 29%
Updated 2 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers