MCPcopy Index your code
hub / github.com/bheisler/cargo-criterion

github.com/bheisler/cargo-criterion @1.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.1.0 ↗ · + Follow
451 symbols 1,176 edges 57 files 80 documented · 18% updated 13mo ago★ 21623 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

cargo-criterion

Criterion-rs Cargo Extension

<a href="https://github.com/bheisler/cargo-criterion/blob/master/CHANGELOG.md">Changelog</a>







<a href="https://crates.io/crates/cargo-criterion">
    <img src="https://img.shields.io/crates/v/cargo-criterion.svg" alt="Crates.io">
</a>

cargo-criterion is a Plugin for Cargo which handles much of the heavy lifting for analyzing and reporting on Criterion-rs benchmarks.

Table of Contents

Features

  • Charts: Uses gnuplot or plotters to generate detailed graphs of benchmark results
  • Reports: In addition to the reports generated by Criterion.rs, cargo-criterion generates a historical report showing the performance of a function over time.
  • Configurable: cargo-criterion's plot generation can be configured using a criterion.toml file.

Quickstart

This assumes that you already have benchmarks which use Criterion-rs. If not, see the Criterion-rs Quickstart Guide. Note that Criterion.rs version 0.3.3 or later is recommended. Benchmarks which do not use Criterion.rs, or which use an earlier version, will run correctly but will not benefit from some of cargo-criterion's features.

First install cargo-criterion:

cargo install cargo-criterion

Then you can use it to run your Criterion-rs benchmarks:

cargo criterion

Goals

  • cargo-criterion seeks to improve iteration time for Criterion-rs benchmarks. By moving functionality into a separate executable which can be installed once and reused, Criterion-rs can shrink - meaning less code to compile and link into the benchmarks themselves.
  • Because cargo-criterion can oversee the whole benchmark process from beginning to end, it's better placed to deliver features that would be difficult to implement in Criterion-rs. These include:
    • Machine-readable output
    • Tracking benchmarked performance over time

Contributing

First, thank you for contributing.

One great way to contribute to cargo-criterion is to use it for your own benchmarking needs and report your experiences, file and comment on issues, etc.

Code or documentation improvements in the form of pull requests are also welcome. If you're not sure what to work on, try checking the Beginner label.

If your issues or pull requests have no response after a few days, feel free to ping me (@bheisler).

For more details, see the CONTRIBUTING.md file.

Compatibility Policy

cargo-criterion supports the last three stable minor releases of Rust. At time of writing, this means Rust 1.50 or later. Older versions may work, but are not tested or guaranteed.

Currently, the oldest version of Rust believed to work is 1.46. Future versions of cargo-criterion may break support for such old versions, and this will not be considered a breaking change. If you require cargo-criterion to work on old versions of Rust, you will need to stick to a specific patch version of cargo-criterion.

Maintenance

cargo-criterion was originally developed and is currently maintained by Brook Heisler (@bheisler).

License

cargo-criterion is dual licensed under the Apache 2.0 license and the MIT license.

Extension points exported contracts — how you extend this code

Tuple (Interface)
Any tuple: `(A, B, ..)` [4 implementers]
src/stats/tuple.rs
Report (Interface)
(no doc) [5 implementers]
src/report.rs
DurationExt (Interface)
Helper trait which adds a function for converting Duration to nanoseconds. [1 implementers]
src/main.rs
PlottingBackend (Interface)
(no doc) [2 implementers]
src/plot/mod.rs
Message (Interface)
(no doc) [2 implementers]
src/message_formats/json.rs
TupledDistributions (Interface)
A tuple of distributions: `(Distribution , Distribution , ..)` [4 implementers]
src/stats/tuple.rs
Plotter (Interface)
(no doc) [1 implementers]
src/plot/mod.rs
TupledDistributionsBuilder (Interface)
A tuple of vecs used to build distributions. [4 implementers]
src/stats/tuple.rs

Core symbols most depended-on inside this repo

iter
called by 117
src/stats/bivariate/mod.rs
map
called by 91
src/stats/univariate/kde/mod.rs
push
called by 72
src/stats/tuple.rs
len
called by 54
src/stats/bivariate/mod.rs
max
called by 36
src/stats/univariate/sample.rs
min
called by 35
src/stats/univariate/sample.rs
clone
called by 32
src/stats/bivariate/mod.rs
as_title
called by 26
src/report.rs

Shape

Method 237
Function 99
Class 84
Enum 21
Interface 10

Languages

Rust100%

Modules by API surface

src/report.rs57 symbols
src/plot/mod.rs44 symbols
src/html/mod.rs31 symbols
src/model.rs21 symbols
src/plot/gnuplot_backend/mod.rs20 symbols
src/connection.rs20 symbols
src/plot/plotters_backend/mod.rs19 symbols
integration_tests/tests/integration_test.rs19 symbols
src/stats/univariate/sample.rs18 symbols
src/stats/univariate/outliers/tukey.rs17 symbols
src/message_formats/json.rs16 symbols
src/config.rs15 symbols

For agents

$ claude mcp add cargo-criterion \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page