-
Notifications
You must be signed in to change notification settings - Fork 4.5k
caches reed-solomon encoder/decoder instance #27510
caches reed-solomon encoder/decoder instance #27510
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 speedup, lgtm
@@ -346,6 +369,38 @@ impl Shredder { | |||
} | |||
} | |||
|
|||
impl ReedSolomonCache { | |||
const CAPACITY: usize = 4 * DATA_SHREDS_PER_FEC_BLOCK; |
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.
nit: A comment on why this should be a function of DATA_SHREDS_PER_FEC_BLOCK
would be helpful
Waiting on upstream reed-solomon-erasure crate merge rust-rse/reed-solomon-erasure#104 first. |
Need to pick up: rust-rse/reed-solomon-erasure#104 in order to unblock: solana-labs#27510
Need to pick up: rust-rse/reed-solomon-erasure#104 in order to unblock: solana-labs#27510
57ec9e2
to
d4ff770
Compare
Pull request has been modified.
Need to pick up: rust-rse/reed-solomon-erasure#104 in order to unblock: #27510
Need to pick up: rust-rse/reed-solomon-erasure#104 in order to unblock: #27510 (cherry picked from commit f02fe9c) # Conflicts: # ledger/Cargo.toml
d4ff770
to
8a837d0
Compare
ReedSolomon::new(...) initializes a matrix and an inversion-tree: https://github.com/rust-rse/reed-solomon-erasure/blob/eb1f66f47/src/core.rs#L450-L458 In order to cache this computation, this commit caches the reed-solomon encoder/decoder instance for each (data_shards, parity_shards) pair.
8a837d0
to
c90a970
Compare
…#28048) * updates reed-solomon-erasure crate version to 6.0.0 (#28033) Need to pick up: rust-rse/reed-solomon-erasure#104 in order to unblock: #27510 (cherry picked from commit f02fe9c) # Conflicts: # ledger/Cargo.toml * removes mergify merge conflicts Co-authored-by: behzad nouri <[email protected]>
With rust-rse/reed-solomon-erasure#104 merged in, this also shows improvement on the recovery end. Also slightly more shreds are recovered (maybe because of faster recovery code): |
ReedSolomon::new(...) initializes a matrix and a data-decode-matrix cache: https://github.com/rust-rse/reed-solomon-erasure/blob/273ebbced/src/core.rs#L460-L466 In order to cache this computation, this commit caches the reed-solomon encoder/decoder instance for each (data_shards, parity_shards) pair. (cherry picked from commit f49beb0)
caches reed-solomon encoder/decoder instance (#27510) ReedSolomon::new(...) initializes a matrix and a data-decode-matrix cache: https://github.com/rust-rse/reed-solomon-erasure/blob/273ebbced/src/core.rs#L460-L466 In order to cache this computation, this commit caches the reed-solomon encoder/decoder instance for each (data_shards, parity_shards) pair. (cherry picked from commit f49beb0) Co-authored-by: behzad nouri <[email protected]>
Problem
ReedSolomon::new(...)
initializes a matrix and a data-decode-matrix cache:https://github.com/rust-rse/reed-solomon-erasure/blob/273ebbced/src/core.rs#L460-L466
Current master code is redoing this computation for each batch.
Summary of Changes
In order to cache this computation, this commit caches the reed-solomon
encoder/decoder instance for each
(data_shards, parity_shards)
pair.