IGNITE-2408 : Removed hotspot from GridDhtAtomicCache$DeferredResponseBuffer.addResponse() caused by a call to size() method which is O(N). Now sizex() method is used instead, which is O(1). This closes #428.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5500a18b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5500a18b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5500a18b Branch: refs/heads/sql-store Commit: 5500a18b4db1326b2089e51f5b5b9870c7113ecf Parents: 4e61602 Author: Ilya Lantukh <[email protected]> Authored: Mon Feb 1 10:42:10 2016 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Mon Feb 1 10:42:10 2016 +0300 ---------------------------------------------------------------------- .../cache/distributed/dht/atomic/GridDhtAtomicCache.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/5500a18b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index 6b23550..cba4e61 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -3084,7 +3084,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { private AtomicBoolean guard = new AtomicBoolean(false); /** Response versions. */ - private Collection<GridCacheVersion> respVers = new ConcurrentLinkedDeque8<>(); + private ConcurrentLinkedDeque8<GridCacheVersion> respVers = new ConcurrentLinkedDeque8<>(); /** Node ID. */ private final UUID nodeId; @@ -3151,7 +3151,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { respVers.add(ver); - if (respVers.size() > DEFERRED_UPDATE_RESPONSE_BUFFER_SIZE && guard.compareAndSet(false, true)) + if (respVers.sizex() > DEFERRED_UPDATE_RESPONSE_BUFFER_SIZE && guard.compareAndSet(false, true)) snd = true; } finally {
