Cargo Features

[dependencies]
criterion = { version = "0.5.1", default-features = false, features = ["stable", "real_blackbox", "async", "async_futures", "async_smol", "async_tokio", "async_std", "html_reports", "cargo_bench_support", "csv_output", "rayon", "plotters"] }
default = cargo_bench_support, plotters, rayon

These default features are set whenever criterion is added without default-features = false somewhere in the dependency tree.

stable = async_futures, async_smol, async_std, async_tokio, csv_output, html_reports
real_blackbox

Enable use of the nightly-only test::black_box function to discourage compiler optimizations.

Affects criterion::black_box

async async_futures? async_smol? async_std? async_tokio? = futures

Enable async/await support

Affects bencher::AsyncBencher

async_futures stable? = async

These features enable built-in support for running async benchmarks on each different async runtime.

Enables executor of futures

Affects async_executor::FuturesExecutor

async_smol stable? = async, smol

Affects async_executor::SmolExecutor

async_tokio stable? = async, tokio
async_std stable? = async, async-std

Affects async_executor::AsyncStdExecutor

html_reports stable?

This feature _currently_ does nothing except disable a warning message, but in 0.4.0 it will be required in order to have Criterion.rs generate its own plots (as opposed to using cargo-criterion)

cargo_bench_support default

This feature _currently_ does nothing except disable a warning message, but in 0.4.0 it will be required in order to have Criterion.rs be usable outside of cargo-criterion.

csv_output stable? = csv

This feature _currently_ does nothing, but in 0.4.0 it will be required in order to have Criterion.rs generate CSV files. This feature is deprecated in favor of cargo-criterion's --message-format=json option.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

rayon default

Enables rayon

Optional dependencies

csv csv_output?
futures async? async_futures?
smol async_smol?

Enables smol ^1.2

tokio async_tokio?
async-std async_std?
plotters default