Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions crates/bencher_compat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/),
Expand Down Expand Up @@ -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:

```
Expand Down
20 changes: 9 additions & 11 deletions crates/criterion_compat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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`:

```
Expand Down
Loading