-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
C-enhancementNew feature or requestNew feature or requestC-perfA change motivated by improving speed, memory usage or disk footprintA change motivated by improving speed, memory usage or disk footprint
Description
Describe the feature
on cache miss
reth/crates/engine/tree/src/tree/cached_state.rs
Lines 148 to 154 in 1902970
| match self.caches.get_storage(&account, &storage_key) { | |
| SlotStatus::NotCached => { | |
| self.metrics.storage_cache_misses.increment(1); | |
| let final_res = self.state_provider.storage(account, storage_key)?; | |
| self.caches.insert_storage(account, storage_key, final_res); | |
| Ok(final_res) | |
| } |
we end up looking up the account cache twice
| let account_cache = self.storage_cache.get(&address).unwrap_or_default(); |
we can avoid this if we also return the optional account cache here:
| pub(crate) fn get_storage(&self, address: &Address, key: &StorageKey) -> SlotStatus { |
Additional context
No response
Metadata
Metadata
Assignees
Labels
C-enhancementNew feature or requestNew feature or requestC-perfA change motivated by improving speed, memory usage or disk footprintA change motivated by improving speed, memory usage or disk footprint
Type
Projects
Status
Done