HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

cargo bench — Compile and execute benchmarks. More information: <https://doc.rust-lang.org/cargo/commands/cargo-be

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandbenchmarkscargo benchandcompileexecuteclimore

Problem

How to use the cargo bench command: Compile and execute benchmarks. More information: <https://doc.rust-lang.org/cargo/commands/cargo-bench.html>.

Solution

cargo bench — Compile and execute benchmarks. More information: <https://doc.rust-lang.org/cargo/commands/cargo-bench.html>.

Execute all benchmarks of a package:
cargo bench


Don't stop when a benchmark fails:
cargo bench --no-fail-fast


Compile, but don't run benchmarks:
cargo bench --no-run


Benchmark the specified benchmark:
cargo bench --bench {{benchmark}}


Benchmark with the given profile (default: bench):
cargo bench --profile {{profile}}


Benchmark all example targets:
cargo bench --examples


Benchmark all binary targets:
cargo bench --bins


Benchmark the package's library:
cargo bench --lib

Code Snippets

Execute all benchmarks of a package

cargo bench

Don't stop when a benchmark fails

cargo bench --no-fail-fast

Compile, but don't run benchmarks

cargo bench --no-run

Benchmark the specified benchmark

cargo bench --bench {{benchmark}}

Benchmark with the given profile (default: `bench`)

cargo bench --profile {{profile}}

Context

tldr-pages: common/cargo bench

Revisions (0)

No revisions yet.