mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
CHENT-49 performance tune repeated puts.
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
<dependency>
|
||||
<groupId>net.openhft</groupId>
|
||||
<artifactId>chronicle-bom</artifactId>
|
||||
<version>1.5.19</version>
|
||||
<version>1.5.21-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -2101,9 +2101,11 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
|
||||
KB key, long keySize, InstanceOrBytesToInstance<KB, K> toKey,
|
||||
ReadValue<RV> readValue, RV usingValue, InstanceOrBytesToInstance<RV, V> toValue,
|
||||
MultiStoreBytes entry) {
|
||||
RV v = null;
|
||||
long valueSize = readValueSize(entry);
|
||||
long valuePos = entry.position();
|
||||
RV v = readValue.readValue(copies, entry, usingValue, valueSize);
|
||||
if (!putReturnsNull)
|
||||
v = readValue.readValue(copies, entry, usingValue, valueSize);
|
||||
|
||||
// get callbacks
|
||||
if (bytesEventListener != null) {
|
||||
@@ -2234,7 +2236,9 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
|
||||
// todo optimize -- prevValue could be read twice
|
||||
if (eventListener != null && !entryIsDeleted) {
|
||||
entry.positionAddr(valueAddr);
|
||||
prevValueInstance = readValue(copies, entry, null, prevValueSize);
|
||||
prevValueInstance = null;
|
||||
if (!putReturnsNull)
|
||||
prevValueInstance = readValue(copies, entry, null, prevValueSize);
|
||||
}
|
||||
|
||||
// putValue may relocate entry and change offset
|
||||
|
||||
Reference in New Issue
Block a user