Skip to content

contrib: Add compare-benches tool#30

Merged
josibake merged 1 commit into
2140-dev:masterfrom
rustaceanrob:26-5-27-compare-benches
May 27, 2026
Merged

contrib: Add compare-benches tool#30
josibake merged 1 commit into
2140-dev:masterfrom
rustaceanrob:26-5-27-compare-benches

Conversation

@rustaceanrob
Copy link
Copy Markdown
Member

When running benchmarks, we are often comparing how changes we've made will impact subsets of the program. nanobench offers an informative table, but does not compare across commits. This is a tool to compare nanobench results across to commits to catch regressions early or to prove statements on performance. I have been using this locally, and decided to generalize it to share.

On approach, this is a Rust binary with 0 dependencies. Rather than using the nanobench JSON output, which would require a JSON parser, the results are parsed directly from stdout. The user can pass the number of runs they would like to perform for each build, and the minimum time of these runs is selected. The default directory to build bench_bitcoin is in the top level build folder, however the user may specify a different name. The user is also able to filter on bench targets using a substring match (i.e. MemPool).

Example usage:
cargo run --release -- --filter SHA256

See the README for more details.

When running benchmarks, we are often comparing how changes we've made
will impact subsets of the program. `nanobench` offers an informative
table, but does not compare across commits. This is a tool to compare
`nanobench` results across to commits to catch regressions early or to
prove statements on performance. I have been using this locally, and
decided to generalize it to share.

On approach, this is a Rust binary with 0 dependencies. Rather than
using the `nanobench` JSON output, which would require a JSON parser,
the results are parsed directly from `stdout`. The user can pass the
number of runs they would like to perform for each build, and the
minimum time of these runs is selected. The default directory to build
`bench_bitcoin` is in the top level `build` folder, however the user may
specify a different name. The user is also able to filter on bench
targets using a substring match (i.e. MemPool).

Example usage:
        `cargo run --release -- --filter SHA256`

See the `README` for more details.
@josibake
Copy link
Copy Markdown
Member

Nice! I think this is fine to add here for now to give people a chance to use it. Longer term, I think we should nuke the contrib/ repo and have a tools repository to host all of these things. I'd like for this repo to eventually be "just the code"

@josibake josibake merged commit 222ba0d into 2140-dev:master May 27, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants