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

Add benchmarks #97

Merged
merged 2 commits into from Apr 4, 2023
Merged

Add benchmarks #97

merged 2 commits into from Apr 4, 2023

Conversation

tcharding
Copy link
Member

Add benchmarks for parsing and encoding bitcoin addresses. Also add two unit tests that parse the same address string used in the benchmarks.

Specifically benchmark:

  • decoding an address
  • encoding an address with allocation
  • encoding an address without allocation

Do so for both Bitcoin bech32 addresses and Bitcoin bech32m addresses.

Patch 1 is preparatory clean up to the readme.

@tcharding tcharding force-pushed the 04-03-bench branch 5 times, most recently from a355a68 to 7dce69c Compare April 3, 2023 01:45
@apoelstra
Copy link
Member

Needs rebase after #88.

README.md Outdated
## Benchmarks

We use a custom Rust compiler configuration conditional to guard the bench mark code. To run the
bench marks use: `RUSTFLAGS='--cfg=bench' cargo +nightly bench`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 692a12c:

I think "benchmark" should be one word (it's split up in two locations).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, good point.

@apoelstra
Copy link
Member

ACK 7dce69c other than the merge conflicts.

@tcharding
Copy link
Member Author

Rebased and fixed spelling of "benchmark" in the readme, no other changes.

Add benchmarks for parsing and encoding bitcoin addresses. Also add two
unit tests that parse the same address string used in the benchmarks.

Specifically benchmark:

- decoding an address
- encoding an address with allocation
- encoding an address without allocation

Do so for both Bitcoin bech32 addresses and Bitcoin bech32m addresses.
We just added benchmarks to the crate, run them in CI when testing with
the nightly toolchain.
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 34e6ab9

@apoelstra apoelstra merged commit 360af7e into rust-bitcoin:master Apr 4, 2023
11 checks passed
@apoelstra apoelstra deleted the 04-03-bench branch April 4, 2023 17:18
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.

None yet

2 participants