-
Notifications
You must be signed in to change notification settings - Fork 21.6k
triedb: track and index the trienode in pathdb lookup #32161
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
Open
jsvisa
wants to merge
13
commits into
ethereum:master
Choose a base branch
from
jsvisa:node-lookup-0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
db7b768 to
d703cab
Compare
499a15d to
e0baf8e
Compare
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
``` go test ./triedb/pathdb/ -bench BenchmarkAddNodes ``` > old ``` goos: linux goarch: amd64 pkg: github.com/ethereum/go-ethereum/triedb/pathdb cpu: AMD Ryzen 7 5700G with Radeon Graphics BenchmarkAddNodes/Small-100-accounts-10-nodes-16 3624 308151 ns/op 1138262 B/op 1236 allocs/op BenchmarkAddNodes/Medium-500-accounts-20-nodes-16 738 2216662 ns/op 10793841 B/op 10352 allocs/op BenchmarkAddNodes/Large-2000-accounts-40-nodes-16 44 27227664 ns/op 92272295 B/op 80897 allocs/op BenchmarkAddNodes/XLarge-5000-accounts-50-nodes-16 13 92061992 ns/op 328729686 B/op 252497 allocs/op PASS ok github.com/ethereum/go-ethereum/triedb/pathdb 20.772s ``` > new ``` goos: linux goarch: amd64 pkg: github.com/ethereum/go-ethereum/triedb/pathdb cpu: AMD Ryzen 7 5700G with Radeon Graphics BenchmarkAddNodes/Small-100-accounts-10-nodes-16 6706 232594 ns/op 673550 B/op 1215 allocs/op BenchmarkAddNodes/Medium-500-accounts-20-nodes-16 804 1292732 ns/op 5910825 B/op 10328 allocs/op BenchmarkAddNodes/Large-2000-accounts-40-nodes-16 60 20907603 ns/op 53871128 B/op 80873 allocs/op BenchmarkAddNodes/XLarge-5000-accounts-50-nodes-16 13 78489762 ns/op 208748856 B/op 252475 allocs/op PASS ok github.com/ethereum/go-ethereum/triedb/pathdb 19.420s ``` Signed-off-by: jsvisa <[email protected]>
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.
Here we use a [16]array of path map to store all the trienodes indexes, then we can split the large storage trienodes into 16 goroutines to do lock-free updates.
The below charts are generated with geth on hoodi network with full sync
Results: