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

Excessive allocation in ParseUtil.encodePath

    XMLWordPrintable

Details

    • b152
    • Not verified

    Description

      "I [...] noticed that sun.net.www.ParseUtil.encodePath(String, boolean) usually had nothing useful to do but still made three copies of the string passed in anyway (two char arrays to work on, and the String returned)."

      http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-December/045180.html

      Scanning the string to see if there are characters that actually need encoding may reduce allocation for applications scanning many jars for resources. However, since file paths on Windows might mean always transforming the String it's important not to regress the "slow" path.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: