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
13
13
## Installation
14
14
15
15
``` sh
16
- cargo add --dev codspeed-bencher-compat
16
+ cargo add --dev codspeed-bencher-compat --rename bencher
17
17
```
18
18
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
+
19
25
## Usage
20
26
21
27
Let's start with the example from the [ Bencher documentation] ( https://docs.rs/bencher/latest/bencher/ ) ,
@@ -51,16 +57,6 @@ name = "example"
51
57
harness = false
52
58
```
53
59
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
-
64
60
And that's it! You can now run your benchmark suite with CodSpeed:
65
61
66
62
```
Original file line number Diff line number Diff line change @@ -13,9 +13,15 @@ Criterion.rs compatibility layer for CodSpeed
13
13
## Installation
14
14
15
15
``` sh
16
- cargo add --dev codspeed-criterion-compat
16
+ cargo add --dev codspeed-criterion-compat --rename criterion
17
17
```
18
18
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
+
19
25
## Usage
20
26
21
27
Let'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"
48
54
harness = false
49
55
```
50
56
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
-
61
57
And that's it! You can now run your benchmark suite with ` cargo-codspeed ` :
62
58
63
59
```
You can’t perform that action at this time.
0 commit comments