]
Adrian Nistor updated ISPN-8517:
--------------------------------
Fix Version/s: 9.2.0.Beta2
(was: 9.2.0.Beta1)
Lazily ressurect ice fromMemory
-------------------------------
Key: ISPN-8517
URL:
https://issues.jboss.org/browse/ISPN-8517
Project: Infinispan
Issue Type: Sub-task
Components: Off Heap
Affects Versions: 9.2.0.Alpha2
Reporter: William Burns
Assignee: William Burns
Fix For: 9.2.0.Beta2, 9.1.3.Final
Currently many places do
{code}
ice = ice = offHeapEntryFactory.fromMemory(address)
if (wrappedKey.equalsWrappedBytes(ice.getKey()))
{code}
In cases where this ends up being a miss, we read the entire value which is wasteful. And
the CPU may not have the key in the cache size we read the object into memory. Where as if
we do
{code}
if (offHeapEntryFactory.equalsKey(address, key))
ice = ice = offHeapEntryFactory.fromMemory(address)
{code}
we know that CPU is reading from the address location twice in a row, which has a very
high chance of still being in CPU caches which should hopefully provide better
performance. We also then don't have to read the entire ice object in memory unless
there was a hit.
We also should change _performGet_ to return the address instead of the ice. This way
callers can use this address for other optimizations such as when doing a _evict_ or
_compute_ which have to read the entry first before a remove.