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 profiling runtime flag, improve merkle performance #105

Merged
merged 13 commits into from
Jun 27, 2023

Conversation

worm-emoji
Copy link
Contributor

@worm-emoji worm-emoji commented Jun 27, 2023

this pull request

  • adds profiling when run with -profile flag
  • adds Tree.Proofs method to merkle package to calculate all proofs at once
  • simplifies tree creation (we didn't need a mutex, and parallelization actually didn't help once we fixed the duplicated work)
  • couple of optimizations for proof generation (preallocating memory, not going back and forth between common.Address and []byte)

this brings the cpu time of inserting a tree with 224,910 records from 98 seconds to 0.4 seconds

profiling is great!

Before and after Screenshot 2023-06-27 at 00 07 30

before

Screenshot 2023-06-27 at 00 50 48

after

@vercel
Copy link

vercel bot commented Jun 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lanyard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 6:42pm

@worm-emoji worm-emoji changed the title add profiling runtime flag, improve tree creation performance add profiling runtime flag, improve merkle performance Jun 27, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

lgtm

@worm-emoji worm-emoji merged commit 8b608fc into main Jun 27, 2023
4 checks passed
@worm-emoji worm-emoji deleted the ylukem/tree-perf branch June 27, 2023 19:04
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