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

(fs) Optimize UnixPath.encode implementation

    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:
      b06

      Description

      UnixPath.encode duplicates the logic exposed via JavaLangAccess.getBytesNoRepl, just with rewrapping any exception thrown in a InvalidPathException. Merging this removes a commonly created ThreadLocal, and will likely hit one of the fast-paths in StringCoding.encode.

      The toCharArray done for the purpose dealing with paths that need normalization on Mac is also costly up front in a way that could be avoided.

      This was found when looking into startup profiles of the Spring PetClinic.

        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: