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

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

    Details

      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:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: