Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-5308

Reduce ConcurrentHashMapv8 allocations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 7.2.0.Beta1
    • Eviction
    • 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.

      1. 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.
      2. 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.

            wburns@redhat.com Will Burns
            wburns@redhat.com Will Burns
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: