-
Notifications
You must be signed in to change notification settings - Fork 123
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 benches for the merkle package #794
Conversation
We need to speed this up if we want to merge this. 618s for 10k items seems really wrong or broken. |
merkle/merkle.go
Outdated
}) | ||
} | ||
|
||
db, err := merkledb.New(ctx, memdb.New(), merkledb.Config{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible that memdb
could be the cause of this.
I talked to @danlaine about writing a much thinner merkle wrapper just for this function (which shouldn't require caches/history/etc).
This reverts commit f009424. focus changes on the bench
var db merkledb.MerkleDB | ||
var err error | ||
|
||
defaultConfig := merkledb.Config{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really want to merge this until this config is largely removed. We need a "single instance" trie that is merkleDB-compatible for #950
This PR has become stale because it has been open for 30 days with no activity. Adding the |
Addresses #689 (comment)
This PR adds a bench to measure the time of generation of the merkle root of transactions.
We execute it for 10, 100, 1000, and 10000 iterations, here are the results:
The average time it takes per operation doesn't scale linearly which makes sense given the tree data-structure.