Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): README Benchmark Doc Updates #906

Merged
merged 1 commit into from
Dec 14, 2023
Merged
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
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,32 @@ run tests with command: `cargo run --release -- statetest tests/GeneralStateTest

## Running benchmarks

TODO needs to be updated. Benches can now be found inside `crates/revm/benches`
Benches can be found in [`crates/revm/benches`](./crates/revm/benches).

Currently, available benches include the following.
- *analysis*
- *snailtracer*
- *transfer*

To run the `snailtracer` bench, execute the `cargo bench` subcommand below.

```shell
cargo run --package revm-test --release --bin snailtracer
cargo bench --package revm --profile release -- snailtracer
```

The following flamegraph will require installing [flamegraph] by running `cargo install flamegraph`.

[flamegraph]: https://docs.rs/crate/flamegraph/0.1.6
Using [flamegraph][flamegraph], you can create a visualization breaking down the runtime of various
sections of the bench execution - a flame graph. Executing the `cargo flamegraph` subcommand requires
installing [flamegraph][flamegraph] by running `cargo install flamegraph`.

```shell
cargo flamegraph --root --freq 4000 --min-width 0.001 --package revm-test --bin snailtracer
cargo flamegraph --root --freq 4000 --min-width 0.001 --package revm --bench bench -- snailtracer
```

This command will produce a flamegraph image output to `flamegraph.svg`.
Flamegraph also requires sudo mode to run (hence the `--root` cli arg) and will prompt you for your password if not in sudo mode already.

[flamegraph]: https://docs.rs/crate/flamegraph/0.1.6

## Running examples

```shell
Expand Down
Loading