CARGO-BENCH(1) General Commands Manual CARGO-BENCH(1) (NAME) cargo-bench - (SYNOPSIS) cargo bench [options] [benchname] [-- bench-options] (DESCRIPTION) . benchname (--) libtest ( rustc ) . Cargo -- Cargo . libtest cargo bench -- --help rustc . foo ( foobar ): cargo bench -- foo --exact --test rustc libtest . #[bench] . Cargo --bench (test harness) libtest . libtest harness = false main . : #[bench] (unstable) nightly . crates.io (stable) Criterion . cargo bench bench . --profile=dev dev . (debugger) . (Working directory of benchmarks) . cargo bench . (OPTIONS) (Benchmark Options) --no-run . --no-fail-fast . Cargo . Rust . ( --manifest-path ). (workspace) . workspace.default-members . ( --workspace) . -p spec, --package spec . SPEC cargo-pkgid(1) . glob * ? [] . glob Cargo . --workspace . --all --workspace. --exclude SPEC . --workspace . glob * ? [] . glob Cargo . (Target Selection) cargo bench : o lib -- o bins ( ) o lib o bins o bench . bench = true main libtest . bench = false . ( --example foo) bench . Configuring a target . . . CARGO_BIN_EXE_ env var . . --bin --example --test --bench glob * ? [] . glob Cargo glob . --lib . --bin name . glob . --bins . --example name . glob . --examples (example). --test name . glob . --tests test = true . (unittest) . lib ( ). test . --bench name . glob . --benches bench = true . bench . lib ( ). bench . --all-targets . --lib --bins --tests --benches --examples . . default . . -F features, --features features . (workspace) package-name/feature-name . . --all-features . --no-default-features default . (Compilation Options) --target triple . . . --- . : o rustc --print target-list. o "host-tuple" . crate ( xtask ). o . Custom Target Lookup Path . build.target . Cargo . . --profile name (profile) . . --timings . cargo-timing.html target/cargo-timings . . . (Output Options) --target-dir directory . CARGO_TARGET_DIR build.target-dir . target . (Display Options) Rust . ( ) --no-capture : cargo bench -- --no-capture -v, --verbose (verbose). " " . term.verbose . -q, --quiet (log) cargo . term.quiet . --color when . : o auto (): . o always: . o never: . term.color . --message-format fmt . . : o human (): . short json . o short: . human json . o json: JSON (stdout). . human short . o json-diagnostic-short: rendered JSON "" rustc . human short . o json-diagnostic-rendered-ansi: rendered JSON ANSI rustc . human short . o json-render-diagnostics: Cargo rustc JSON Cargo JSON rustc . JSON Cargo rustc . human short . --manifest-path path Cargo.toml. Cargo Cargo.toml . --ignore-rust-version rust-version . --locked Cargo.lock . Cargo : o lock . o Cargo lock . (deterministic) CI . --offline Cargo . Cargo . Cargo . (online) . Cargo crate (index) . cargo-fetch(1) . net.offline . --frozen --locked --offline . (Common Options) +toolchain Cargo rustup cargo + (toolchain) rustup ( +stable +nightly). rustup . --config KEY=VALUE PATH Cargo . TOML KEY=VALUE . . . -C PATH . cargo (Cargo.toml) .cargo/config.toml . cargo -C path/to/my-project build. nightly -Z unstable-options (: #10098 ). -h, --help . -Z flag ( nightly) Cargo. cargo -Z help . --jobs . Rust . -j N, --jobs N . build.jobs . CPU . CPU . default . 0 . cargo bench --keep-going . --no-fail-fast . "" --benches . : cargo build --benches --release --keep-going cargo bench --no-fail-fast (ENVIRONMENT) Cargo . (EXIT STATUS) o 0: Cargo . o 101: Cargo . (EXAMPLES) 1. : cargo bench 2. : cargo bench --bench bench_name -- modname::some_benchmark (SEE ALSO) cargo(1), cargo-test(1) CARGO-BENCH(1)