Merged
Conversation
SuperFluffy
approved these changes
Jun 18, 2024
Contributor
SuperFluffy
left a comment
There was a problem hiding this comment.
This is very nice to have, thank you!
Another nice bench would be looking at how the leaves of our tree can be constructed ad-hoc by writing their bytes directly into a hasher. We actually make use of this inside sequencer because we construct proofs over data included in a block by using (rollup_id || rollup_data) and this way we avoid allocating byte vectors for every single leaf.
steezeburger
added a commit
that referenced
this pull request
Jun 19, 2024
* main: chore(bridge-withdrawer): add missing errors and clean up names (#1178) feat(sequencer): add ttl and invalid cache to app mempool (#1138) chore(astria-merkle): add benchmarks (#1179) chore(sequencer-relayer): add timeout to gRPCs to Celestia app (#1191) refactor(core): parse ics20 denoms as ibc or trace prefixed variants (#1181) Mycodecrafting/sequencer seed node (#1188) chore: register all metrics during startup (#1144) feat(charts): option to purge geth mempool (#1182)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added benchmarks to
astria-merkleusing Divan.Background
We wanted benchmarks to measure the performance of the crate, and to be able to spot performance regressions in the future.
I chose Divan over the more established Criterion for a few reasons:
It is not without drawbacks though, most of which are identified as future plans for Divan:
I also included benchmarks for a similar crate:
ct-merklewhich adheres to RFC 6962. The results show that generally our implementation is slightly faster across most input selections, and that it performs the same or fewer allocations.Changes
bench_include_allocsfeature enabled.Testing
These are tests.
Example of running `cargo bench -q -p astria-merkle` on my Ryzen 7900X
Related Issues
Closes #1176.