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

Reduce allocation in sun.net.www.protocol.jar.Handler.parseURL

    XMLWordPrintable

Details

    • b07

    Description

      As suggested by Eirik Bjørsnøs at https://mail.openjdk.java.net/pipermail/core-libs-dev/2021-January/073277.html:

      sun.net.www.protocol.jar.Handler.parseURL unconditionally calls
      String.substring twice on the spec string, even when ParseUtil.canonizeString later determines that no canonization was required.

      By letting canonizeString do the substring calls, but only when it
      determines that it is needed, we can remove some unnecessary String and byte[] allocations.

      Attachments

        Issue Links

          Activity

            People

              redestad Claes Redestad
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: