Creating
Creating a new Criterion-based benchmarking crate for one of Cuprate's crates is relatively simple, although, it requires knowledge of how to use Criterion first:
- Read the
Getting Startedsection of https://bheisler.github.io/criterion.rs/book - Copy
benches/criterion/exampleas base - Get started
Naming
New benchmark crates using Criterion should:
- Be in
benches/criterion/ - Be in the
cuprate-criterion-$CRATE_NAMEformat
For a real example, see:
cuprate-criterion-json-rpc.
Workspace
Finally, make sure to add the benchmark crate to the workspace
Cargo.toml file.
Your benchmark is now ready to be ran.