-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
7.2.0.Beta1
-
None
The current EquivalentConcurrentHashMapv8 allocates a lot of extra entries for the sake of atomicity. It would be helpful to reduce these allocations if possible.
- Whenever a get refreshes an entries recency we have to allocate a new DequeNode. This is because of ConcurrentLinkedDeque not always removing the node (this can happen when the node is a head or tail node. If we are able to detect when the node was removed and reuse it it will drastically reduce how many allocations this uses since a deque should rarely be removed from the head or tail on a get.
- The current size and current number of evicting elements is stored as 2 longs in a custom class. We have to use compare and set semantics to keep these correct. If instead we utilized a single long where the top 16 bits are reserved for number of evicting elements (concurrent puts) and used the bottom 48 bits for the actual size we can use a simple AtomicLong instead.
- relates to
-
ISPN-5329 Reduce number of allocations
- Resolved