Criterion.rs

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

Library
Cargo
v0.8.2
481 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 →
65 /100 Good
Development Activity 60
Maintenance 68
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
100%
Other

Meilisearch

Search

59,644

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
90
Repo Health
88
Technical
67
Dependency
Built with
Rust 100%
Updated 1 weeks ago
Rust
71%
MIT

monty

AI Development · Developer Tools

8,763

Run LLM-generated Python code safely inside your agent—no containers, no CPython, no compromise—with sub-microsecond startup.

View details
88
Repo Health
83
Technical
73
Dependency
Built with
Rust 71%
Python 24%
Updated 1 weeks ago
Rust
93%
Apache 2.0

Murr

Databases

117

A RocksDB-based NVMe/S3 cache purpose-built for AI inference workloads — a faster Redis replacement optimized for batch, low-latency, zero-copy reads and writes between data pipelines and inference apps.

View details
73
Repo Health
72
Technical
75
Dependency
Built with
Rust 93%
Updated 1 weeks ago
C++
43%
MIT

openduck

Data Engineering · Databases

576

OpenDuck brings MotherDuck-style cloud capabilities to self-hosted DuckDB — attach remote databases, run hybrid queries across local and remote nodes, and own your data with an open gRPC and Arrow IPC protocol.

View details
26
Repo Health
76
Technical
76
Dependency
Built with
C++ 43%
Rust 38%
HTML 13%
Updated 5 months ago
TypeScript
39%
AGPL 3.0

OpenObserve

Analytics · Devops · Monitoring

22,475

Open source observability platform for logs, metrics, traces, and real user monitoring — delivering 140x lower storage costs than Elasticsearch with a single binary you can run in under 2 minutes.

View details
90
Repo Health
9
Technical
68
Dependency
Built with
TypeScript 39%
Rust 30%
Vue 17%
Updated 6 days ago
Python
73%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

40,705

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 73%
TypeScript 12%
Rust 11%
Updated 6 days ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

40,397

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 6 days ago
Java
93%
Apache 2.0

QuestDB

Analytics · Databases

17,466

A high-performance, open-source time-series database built for financial market data, IoT telemetry, and real-time analytics, combining a zero-GC Java/C++ core with SIMD-accelerated SQL and a WAL-to-Parquet storage engine.

View details
91
Repo Health
86
Technical
67
Dependency
Built with
Java 93%
Updated 6 days ago
Rust
97%
MPL 2.0

Sonic

Databases · Search

21,366

Fast, lightweight, schema-less search backend in Rust — microsecond queries, 30MB RAM, no document storage required.

View details
88
Repo Health
88
Technical
70
Dependency
Built with
Rust 97%
Updated 1 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