AcctIdx: support unref first class for perf (#20638)
This commit is contained in:
committed by
GitHub
parent
e11f1b3e9e
commit
9b042fed30
@ -1637,9 +1637,8 @@ impl<T: IndexValue> AccountsIndex<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn unref_from_storage(&self, pubkey: &Pubkey) {
|
pub fn unref_from_storage(&self, pubkey: &Pubkey) {
|
||||||
if let Some(locked_entry) = self.get_account_read_entry(pubkey) {
|
let map = &self.account_maps[self.bin_calculator.bin_from_pubkey(pubkey)];
|
||||||
locked_entry.unref();
|
map.read().unwrap().unref(pubkey)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ref_count_from_storage(&self, pubkey: &Pubkey) -> RefCount {
|
pub fn ref_count_from_storage(&self, pubkey: &Pubkey) -> RefCount {
|
||||||
|
@ -290,6 +290,10 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn unref(&self, pubkey: &Pubkey) {
|
||||||
|
self.get_internal(pubkey, |entry| entry.map(|entry| entry.add_un_ref(false)));
|
||||||
|
}
|
||||||
|
|
||||||
pub fn upsert(
|
pub fn upsert(
|
||||||
&self,
|
&self,
|
||||||
pubkey: &Pubkey,
|
pubkey: &Pubkey,
|
||||||
|
Reference in New Issue
Block a user