diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-19 16:31:48 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-20 12:24:03 +0200 |
commit | c37daad91ebab5ac5b74c34631491ffd5999c87f (patch) | |
tree | 868234ec92e1483f38308236ab3bb7bf97d1a770 | |
parent | 5994213a0f7b97a595442d4f15c4e040bcac2986 (diff) |
bench: Improve usage description.
-rw-r--r-- | openpgp/benches/README.md | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/openpgp/benches/README.md b/openpgp/benches/README.md index 38418da7..eb04543d 100644 --- a/openpgp/benches/README.md +++ b/openpgp/benches/README.md @@ -6,22 +6,52 @@ We use [`criterion`](https://crates.io/crates/criterion) as a benchmark framewor * produces nice plots * and is compatible with stable Rust. -To run the benchmarks, run +### Usage + +To compare your work to `main`: + +``` +git switch main +cargo bench -- --save-baseline main +git switch branchname +cargo bench --baseline main +``` +The html report can then be found at `sequoia/target/criterion/report/index.html`. + +You can also create a report for two stored baselines without running the +benchmarks again: +``` +cargo bench --load-baseline my_baseline --baseline main +``` +#### Critmp + +Criterion can only include up to two baselines in one report. +If you'd like to compare more than two stored baselines, or see a report on the +command line, use [`critcmp`], e.g. +``` +critcmp my_baseline my_other_baseline main +``` + +[`critcmp`]: https://crates.io/crates/critcmp + +#### Useful commands + +To run the benchmarks: ``` cargo bench ``` -To run a specific benchmark, run +To run a specific benchmark: ``` cargo bench -- benchmark_name ``` -To test the benchmarks, run +To test the benchmarks: ``` cargo test --benches ``` -To test a specific benchmark +To test a specific benchmark: ``` cargo test --benches -- benchmark_name ``` |