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

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

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 17
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: