Open aadrijnberg opened 2 months ago
According to the FAQ, it should work with the explicit --bench my_benchmark
argument:
cargo bench --bench my_benchmark -- --verbose
Note that my_benchmark here corresponds to the name of your benchmark in your Cargo.toml file.
Another option is to disable benchmarks for your lib or app crate. For example, for library crates, you could add this to your Cargo.toml file:
[lib]
bench = false
It is not that I cannot run the benchmarks, it is just that I cannot use the "save-baseline" feature. And I was wondering if my command line was wrong, or that this feature is not working as documented...
It is not that I cannot run the benchmarks, it is just that I cannot use the "save-baseline" feature. And I was wondering if my command line was wrong, or that this feature is not working as documented...
I think my previous comment answers your question. The linked FAQ regards this specific case: 'cargo bench gives "Unrecognized Option" Errors for Valid Command-line Options'
Side note: If you run cargo bench -- --help
the end of the message links to this exact same FAQ.
In your case, try:
cargo bench --bench my_benchmark -- --save-baseline initial
instead of
cargo bench -- --save-baseline initial
Hah, thanks! That works.
When following the documentation to save a baseline with a name, it returns an error. See https://github.com/aadrijnberg/criterion-benchmark for the repo that tries to use it, but fails with an error:
Did I use the wrong command line parameters to store the baseline under a certain name, or is it not working in v0.5