-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(primitives) : Chunk Implementation for Parallel Sender Recovery #5224
Conversation
Thanks for taking this on! How does this impl compare perf wise to the current impl on main? |
supportive of @onbjerg comments:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
let chunks = rayon::current_num_threads() * 8; | ||
let chunk_size: usize = (num_txes / chunks) / 8; | ||
let chunk_size = chunk_size.max(2); |
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.
these constants seem a bit too arbitrary/random
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.
Can definitely change that
Some(recovered_signers) | ||
}) | ||
.join() | ||
.unwrap() |
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.
can we remove this unwrap? even if we have to change to Result<Option<...>>
Can you re-run this with mainnet SenderRecovery stage via |
…_impl Chunk Impl for Parallel Sender Recovery
Hi @Arindam2407 wonder if you had a chance to compare performance before/after? |
…_impl Updated reth-primitives src/transactions/mod.rs
…_impl Updated crates for reth-primitives src/transactions/mod.rs
Hi @gakonst, I was not able to run the mainnet SenderRecovery stage because of my device specs. Instead, I ran optimized tests using cargo test --package reth-primitives --release to get more reliable measurement as pointed out by @rakita. I compared the performance before/after (without/with chunks) for recovering 100,000 transactions. The test: Additional crates used in mod tests: use std::{fs::File, io::Write, time::Instant};
Chunk implementation takes 20-30% less time than the current implementation in all runs. It would be great if anyone else could run it and compare the performance. Since they are all optimized test runs, I think the estimates are reliable. |
Updating git repository `https://github.com/bluealloy/revm` Updating git repository `https://github.com/sigp/discv5` Updating git repository `https://github.com/stevefan1999-personal/rust-igd` Updating boyer-moore-magiclen v0.2.18 -> v0.2.19 Updating hashbrown v0.14.2 -> v0.14.3 Updating proc-macro2 v1.0.69 -> v1.0.70
chore(deps): weekly `cargo update`
Added chunk implementation to TransactionSigned::recover_signers using stream wrappers to handle parallel sender recovery using rayon. Replaced into_par_iter method handling parallel sender recovery for one signed transaction at a time. Partially resolving #5189 issue.