-
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: adds parallelization to SenderRecovery
and TxLookup
using SnapshotProvider
#6654
Conversation
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.
nice, nits
pending @shekhirin
#[derive(Debug, Default, Clone)] | ||
pub struct SnapshotProvider(Arc<SnapshotProviderInner>); |
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.
cool, this now closes the other pr that adds this main
pub fn with_filters(self) -> Self { | ||
let mut provider = | ||
Arc::try_unwrap(self.0).expect("should be called when initializing only."); |
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.
for followup, this should be called during SnapshotProvider::new
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
d75d4e3
to
043f07d
Compare
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.
LGTM, only nits
@@ -194,18 +194,26 @@ impl TestStageDB { | |||
/// Insert ordered collection of [SealedBlock] into corresponding tables. | |||
/// Superset functionality of [TestStageDB::insert_headers]. | |||
/// | |||
/// If tx_offset is set to `None`, then transactions will be stored on static files, otherwise |
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.
oof imo it's easy to misuse. Maybe an explicit enum?
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Changes
SnapshotProvider
should beArc<SnapshotProviderInner>
#6249transaction_hashes_by_range
on static files parallel: each rayon worker reads the file(and deserializes) on their own vs mdbx where reading and deserialization is done on the main thread before sending it to rayon workers for hashing.chunk_size
on parallelization is set to100
: Kinda arbitrary. The way it was before it was too high and there were a bunch of rayon threads waiting for work. (image comparison incoming)Benches
holesky
maxperf
@ block 925555TransactionLookup
went from [57s-59s] to [47s-50s].SenderRecovery
didn't benefit from static files (heavily cpu bound), but thechunk_size
reduction helped it go from 49s to 44s.