Skip to content

Commit

Permalink
Add benchmark instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikvanantwerpen committed Oct 1, 2024
1 parent f05019b commit 6ea06fa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions crates/bpe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,20 @@ Results for encoding o200k tokens for random 1000 bytes. The backtracking encode
Results for incrementally encoding o200k tokens by appending 10000 random bytes. The appending encoder is slower by a constant factor but overall has similar performance curve as the backtracking encoder encoding all data at once.

![appending runtime comparison](./benches/result/appending-o200k.svg)

### Running

Run the benchmark as follows (required [cargo-criterion](https://crates.io/crates/cargo-criterion) installed):

```sh
cargo criterion
```

(Using `cargo bench` ignores the settings in `criterion.toml`!)
Open the full report which should be located in `target/criterion/reports/index.html`.

Update the figures in this repo as follows (requires `rsvg-convert` from `librsvg` installed):

```sh
script/copy-benchmark-results
```

0 comments on commit 6ea06fa

Please sign in to comment.