-
Notifications
You must be signed in to change notification settings - Fork 2.2k
perf(engine): paralellize evm_state_to_hashed_post_state() #20635
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?
perf(engine): paralellize evm_state_to_hashed_post_state() #20635
Conversation
|
Nice - what's the impact of this overall? |
|
the function is called by the payload processor i got these results when benchmarking on my machine
i think there's another PR working on this as well #20475 |
mattsse
left a comment
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.
imo this makes a lot of sense
we can even simplify the collect impl with #20653
| .collect(); | ||
|
|
||
| let mut hashed_state = HashedPostState::with_capacity(hashed.len()); | ||
| for (hashed_address, info, hashed_storage) in hashed { | ||
| hashed_state.accounts.insert(hashed_address, info); | ||
| if let Some(storage) = hashed_storage { | ||
| hashed_state.storages.insert(hashed_address, storage); |
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.
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.
on it
34bf944 to
f489c99
Compare
|
there's potentially another optimization, similar to this one, here: reth/crates/engine/tree/src/tree/payload_processor/prewarm.rs Lines 768 to 779 in 05b3a86
|
according to benchmarks, this increasingly improves perf if accounts accessed >20, below this value a sequential approach is more beneficial due to overhead