Alter ordering
don't try the cache hit before checking for presence, only look in the cache if protecting a lookup from the persisted part
This commit is contained in:
parent
480820e466
commit
6e5f5d2d44
1 changed files with 10 additions and 10 deletions
|
@ -230,17 +230,17 @@ fetch(LedgerKey, Hash, State) ->
|
||||||
{not_present, summary_bloom, null};
|
{not_present, summary_bloom, null};
|
||||||
true ->
|
true ->
|
||||||
Slot = lookup_slot(LedgerKey, Summary#summary.index),
|
Slot = lookup_slot(LedgerKey, Summary#summary.index),
|
||||||
|
SlotBloom = Slot#slot_index_value.bloom,
|
||||||
|
case is_check_slot_required({hash, Hash}, SlotBloom) of
|
||||||
|
false ->
|
||||||
|
{not_present, slot_bloom, null};
|
||||||
|
true ->
|
||||||
CacheEntry = array:get(Slot#slot_index_value.slot_id,
|
CacheEntry = array:get(Slot#slot_index_value.slot_id,
|
||||||
State#state.cache),
|
State#state.cache),
|
||||||
case CacheEntry of
|
case CacheEntry of
|
||||||
{LedgerKey, CachedValue} ->
|
{LedgerKey, CachedValue} ->
|
||||||
{{LedgerKey, CachedValue}, cache_entry, null};
|
{{LedgerKey, CachedValue}, cache_entry, null};
|
||||||
_ ->
|
_ ->
|
||||||
SlotBloom = Slot#slot_index_value.bloom,
|
|
||||||
case is_check_slot_required({hash, Hash}, SlotBloom) of
|
|
||||||
false ->
|
|
||||||
{not_present, slot_bloom, null};
|
|
||||||
true ->
|
|
||||||
SlotLook = lookup_in_slot(LedgerKey,
|
SlotLook = lookup_in_slot(LedgerKey,
|
||||||
{pointer,
|
{pointer,
|
||||||
State#state.handle,
|
State#state.handle,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue