File tree Expand file tree Collapse file tree 2 files changed +14
-22
lines changed Expand file tree Collapse file tree 2 files changed +14
-22
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,15 @@ 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+
1925## Usage
2026
2127Let's start with the example from the [ Bencher documentation] ( https://docs.rs/bencher/latest/bencher/ ) ,
@@ -51,16 +57,6 @@ name = "example"
5157harness = false
5258```
5359
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-
6460And that's it! You can now run your benchmark suite with CodSpeed:
6561
6662```
Original file line number Diff line number Diff line change @@ -13,9 +13,15 @@ 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+
1925## Usage
2026
2127Let's start with the example from the [ Criterion.rs documentation] ( https://bheisler.github.io/criterion.rs/book/getting_started.html ) ,
@@ -48,16 +54,6 @@ name = "my_benchmark"
4854harness = false
4955```
5056
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-
6157And that's it! You can now run your benchmark suite with ` cargo-codspeed ` :
6258
6359```
You can’t perform that action at this time.
0 commit comments