-
Notifications
You must be signed in to change notification settings - Fork 2.2k
perf: spawn storage root tasks in parallel #20585
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
base: main
Are you sure you want to change the base?
Conversation
crates/trie/parallel/src/root.rs
Outdated
| }); | ||
|
|
||
| // Insert all receivers into the storage_roots map | ||
| for (hashed_address, rx) in receivers { |
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.
Is this intermediate receives Vec necessary? Could we instead insert directly into storage_roots in the for-loop above?
08ec6c3 to
3220ad1
Compare
143098c to
e314970
Compare
|
@mediocregopher , Good point! Much cleaner this way. Updated, please let me know if you see any other improvements needed. Thanks for the feedback! |
|
cc @yongkangc |
|
Does this improve sparse trie / work we are optimizing rn Brian? Or is it mostly for fallback code? |
@gakonst this is in the legacy state root code path, won't affect the sparse trie |
Spawns storage root calculation tasks in parallel instead of serially, reduces task initialization overhead.