Criterion.rs

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

Library
Cargo
v0.8.2
420stars
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/100Fair
Development Activity52
Maintenance56
Community56
Maturity32
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
82/100Excellent
Architecture84
Code Quality82
Innovation85
Learning Curve78

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
64%
Apache 2.0

agentgateway

AI Development · Developer Tools

4,420

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
72
Dependency
Built with
Rust64%
Go24%
Updated yesterday
Rust
67%
MIT

Bun

Developer Tools

95,452

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
66
Dependency
Built with
Rust67%
C++19%
Updated today
Rust
95%
MIT

claw-code

AI Agents · AI Code Assistants

195,087

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
71
Repo Health
71
Technical
77
Dependency
Built with
Rust95%
Updated 3 days ago
Rust
52%
Apache 2.0

cocoindex

Data Engineering · AI Development

11,350

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

View details
87
Repo Health
85
Technical
64
Dependency
Built with
Rust52%
Python48%
Updated yesterday
Rust
100%
Other

Fluree DB

Databases

445

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
86
Repo Health
74
Technical
65
Dependency
Built with
Rust100%
Updated yesterday
Python
80%
Apache 2.0

headroom

AI Development · Developer Tools

66,835

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
84
Repo Health
86
Technical
73
Dependency
Built with
Python80%
Rust14%
Updated today
Rust
72%
Other

iii

Developer Tools · Devops

18,604

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

View details
86
Repo Health
85
Technical
69
Dependency
Built with
Rust72%
TypeScript17%
Updated yesterday
Rust
96%
Apache 2.0

InfluxDB

Databases · Analytics

31,705

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
86
Repo Health
76
Technical
72
Dependency
Built with
Rust96%
Updated yesterday
Rust
46%
MIT

Meetily

Productivity · AI Assistants

29,484

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

View details
70
Repo Health
72
Technical
71
Dependency
Built with
Rust46%
TypeScript30%
Updated 2 months 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

Search