tldr/pages/common/cargo-bench.md

37 lines
670 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 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`
- Compile, but dont run benchmarks:
`cargo bench --no-run`
- Benchmark only the specified packages:
`cargo bench --package {{package}}`
- 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`