File tree Expand file tree Collapse file tree 2 files changed +18
-22
lines changed
Expand file tree Collapse file tree 2 files changed +18
-22
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,17 @@ Bencher compatibility layer for CodSpeed
1313## Installation
1414
1515``` sh
16- cargo add --dev codspeed-bencher-compat
16+ cargo add --dev codspeed-bencher-compat --rename bencher
1717```
1818
19+ > [ !NOTE]
20+ > This will install the ` codspeed-bencher-compat ` crate and rename it to ` bencher ` in your ` Cargo.toml ` .
21+ > This way, you can keep your existing imports and the compatibility layer will take care of the rest.
22+ >
23+ > Using the compatibility layer won't change the behavior of your benchmark suite and Bencher will still run it as usual.
24+ >
25+ > If you prefer, you can also install ` codspeed-bencher-compat ` as is and change your imports to use this new crate name.
26+
1927## Usage
2028
2129Let's start with the example from the [ Bencher documentation] ( https://docs.rs/bencher/latest/bencher/ ) ,
@@ -51,16 +59,6 @@ name = "example"
5159harness = false
5260```
5361
54- ### Plugging CodSpeed
55-
56- To allow CodSpeed to interact with this suite as well, you simply need to replace
57- the imports from the ` bencher ` crate to the ` codspeed-bencher-compat ` crate:
58-
59- ``` diff
60- - use bencher::{benchmark_group, benchmark_main, Bencher};
61- + use codspeed_bencher_compat::{benchmark_group, benchmark_main, Bencher};
62- ```
63-
6462And that's it! You can now run your benchmark suite with CodSpeed:
6563
6664```
Original file line number Diff line number Diff line change @@ -13,9 +13,17 @@ Criterion.rs compatibility layer for CodSpeed
1313## Installation
1414
1515``` sh
16- cargo add --dev codspeed-criterion-compat
16+ cargo add --dev codspeed-criterion-compat --rename criterion
1717```
1818
19+ > [ !NOTE]
20+ > This will install the ` codspeed-criterion-compat ` crate and rename it to ` criterion ` in your ` Cargo.toml ` .
21+ > This way, you can keep your existing imports and the compatibility layer will take care of the rest.
22+ >
23+ > Using the compatibility layer won't change the behavior of your benchmark suite and Criterion.rs will still run it as usual.
24+ >
25+ > If you prefer, you can also install ` codspeed-criterion-compat ` as is and change your imports to use this new crate name.
26+
1927## Usage
2028
2129Let'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"
4856harness = false
4957```
5058
51- ### Plugging CodSpeed
52-
53- To allow CodSpeed to interact with this suite as well, you simply need to replace
54- the imports from the ` criterion ` crate to the ` codspeed-criterion-compat ` crate:
55-
56- ``` diff
57- - use criterion::{black_box, criterion_group, criterion_main, Criterion};
58- + use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Criterion};
59- ```
60-
6159And that's it! You can now run your benchmark suite with ` cargo-codspeed ` :
6260
6361```
You can’t perform that action at this time.
0 commit comments