diff --git a/crates/bencher_compat/README.md b/crates/bencher_compat/README.md index 0420f515..cb3f65be 100644 --- a/crates/bencher_compat/README.md +++ b/crates/bencher_compat/README.md @@ -13,9 +13,17 @@ Bencher compatibility layer for CodSpeed ## Installation ```sh -cargo add --dev codspeed-bencher-compat +cargo add --dev codspeed-bencher-compat --rename bencher ``` +> [!NOTE] +> This will install the `codspeed-bencher-compat` crate and rename it to `bencher` in your `Cargo.toml`. +> This way, you can keep your existing imports and the compatibility layer will take care of the rest. +> +> Using the compatibility layer won't change the behavior of your benchmark suite and Bencher will still run it as usual. +> +> If you prefer, you can also install `codspeed-bencher-compat` as is and change your imports to use this new crate name. + ## Usage Let's start with the example from the [Bencher documentation](https://docs.rs/bencher/latest/bencher/), @@ -51,16 +59,6 @@ name = "example" harness = false ``` -### Plugging CodSpeed - -To allow CodSpeed to interact with this suite as well, you simply need to replace -the imports from the `bencher` crate to the `codspeed-bencher-compat` crate: - -```diff -- use bencher::{benchmark_group, benchmark_main, Bencher}; -+ use codspeed_bencher_compat::{benchmark_group, benchmark_main, Bencher}; -``` - And that's it! You can now run your benchmark suite with CodSpeed: ``` diff --git a/crates/criterion_compat/README.md b/crates/criterion_compat/README.md index 3f73f0d1..67970e8b 100644 --- a/crates/criterion_compat/README.md +++ b/crates/criterion_compat/README.md @@ -13,9 +13,17 @@ Criterion.rs compatibility layer for CodSpeed ## Installation ```sh -cargo add --dev codspeed-criterion-compat +cargo add --dev codspeed-criterion-compat --rename criterion ``` +> [!NOTE] +> This will install the `codspeed-criterion-compat` crate and rename it to `criterion` in your `Cargo.toml`. +> This way, you can keep your existing imports and the compatibility layer will take care of the rest. +> +> Using the compatibility layer won't change the behavior of your benchmark suite and Criterion.rs will still run it as usual. +> +> If you prefer, you can also install `codspeed-criterion-compat` as is and change your imports to use this new crate name. + ## Usage Let's start with the example from the [Criterion.rs documentation](https://bheisler.github.io/criterion.rs/book/getting_started.html), @@ -48,16 +56,6 @@ name = "my_benchmark" harness = false ``` -### Plugging CodSpeed - -To allow CodSpeed to interact with this suite as well, you simply need to replace -the imports from the `criterion` crate to the `codspeed-criterion-compat` crate: - -```diff -- use criterion::{black_box, criterion_group, criterion_main, Criterion}; -+ use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Criterion}; -``` - And that's it! You can now run your benchmark suite with `cargo-codspeed`: ```