Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8176894

Provide specialized implementation for default methods putIfAbsent, computeIfAbsent, computeIfPresent, compute, merge in TreeMap

    Details

    • Type: Enhancement
    • Status: In Progress
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 10
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:

      Description

      TreeMap doesn't have specialized implementation for methods putIfAbsent(), computeIfAbsent(), computeIfPresent(), compute(). Default implementation frequently leads to twice tree traversal, that hurts performance.

      Implementation: http://cr.openjdk.java.net/~skuksenko/corelibs/utils/8176894/webrev.00/

      Suggested implementation improve performance of all 4 operations within 40%-100% (than higher cost of compare operation than more performance boost).

      Note: some of these operations are used in new HttpClient (JEP-110, jdk.incubator.httpclient). Performance speedup for HTTP/2 requests are within 5%-15% (depends on size of HTTP headers)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tvaleev Tagir Valeev
                Reporter:
                skuksenko Sergey Kuksenko
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: