From 8e278ae62b6715a3dcd0893cfe2b1e48915c225b Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Tue, 4 Nov 2014 15:44:48 +0000 Subject: [PATCH] HCOLL-155 added a kvContext.dontPutOnClose(); to imporve performance on aquireUsing(key,value) --- .../net/openhft/chronicle/map/VanillaChronicleMap.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index f827a5e8f..9a5c0ea95 100644 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -383,11 +383,15 @@ class VanillaChronicleMap, return this.lookupUsing(key, usingValue, LockType.READ_LOCK); } - // todo remove + @Override public V acquireUsing(K key, V usingValue) { - try (Context kvContext = lookupUsing(key, usingValue, LockType.WRITE_LOCK)) { + try (WriteContext kvContext = lookupUsing(key, usingValue, LockType.WRITE_LOCK)) { + + if (!isNativeValueClass) + kvContext.dontPutOnClose(); + return kvContext.value(); } }