uses structural sharing for stake-delegations hash-map (#23585)
StakeDelegations is using Arc to implement copy-on-write semantics: https://github.com/solana-labs/solana/blob/58c0db970/runtime/src/stake_delegations.rs#L14-L16 However a single delegation change will still clone the entire hash-map, resulting in excessive memory use as observed in: https://github.com/solana-labs/solana/issues/23061#issuecomment-1063444072 This commit instead uses immutable hash-map implementing structural sharing: > which means that if two data structures are mostly copies of each > other, most of the memory they take up will be shared between them. https://docs.rs/im/latest/im/
This commit is contained in:
@@ -52,7 +52,6 @@ pub mod snapshot_hash;
|
||||
pub mod snapshot_package;
|
||||
pub mod snapshot_utils;
|
||||
pub mod sorted_storages;
|
||||
pub mod stake_delegations;
|
||||
pub mod stake_history;
|
||||
pub mod stake_weighted_timestamp;
|
||||
pub mod stakes;
|
||||
|
Reference in New Issue
Block a user