tldr/pages/common/cargo-bench.md

37 lines
659 B
Markdown
Raw Normal View History

# 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`
2023-10-29 08:54:53 +00:00
- Don't stop when a benchmark fails:
2023-10-29 08:54:53 +00:00
`cargo bench --no-fail-fast`
2023-10-29 08:54:53 +00:00
- Compile, but dont run benchmarks:
2023-10-29 08:54:53 +00:00
`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 packages library:
`cargo bench --lib`