processes pull-request callers only once per unique caller (#13750)
process_pull_requests acquires a write lock on crds table to update records timestamp for each of the pull-request callers: https://github.com/solana-labs/solana/blob/3087c9049/core/src/crds_gossip_pull.rs#L287-L300 However, pull-requests overlap a lot in callers and this function ends up doing a lot of redundant duplicate work. This commit obtains unique callers before acquiring an exclusive lock on crds table.
This commit is contained in:
@@ -240,8 +240,8 @@ impl Crds {
|
||||
|
||||
/// Update the timestamp's of all the labels that are associated with Pubkey
|
||||
pub fn update_record_timestamp(&mut self, pubkey: &Pubkey, now: u64) {
|
||||
for label in &CrdsValue::record_labels(pubkey) {
|
||||
self.update_label_timestamp(label, now);
|
||||
for label in CrdsValue::record_labels(*pubkey) {
|
||||
self.update_label_timestamp(&label, now);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user