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

Optimize ZipFile.getEntry by folding lookups for name and name+'/'

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 15
    • Component/s: core-libs

      Description

      When requested, ZipFile.getEntry looks up entries named name, then name+'/'. By discarding the trailing slash when calculating hash code, we ensure such entries are found at the same hash table entry. This means we jump around less in the hash table, do fewer calculations per lookup, which ends up being a significant speed-up.

      See discusssion and patch suggested by Eirik Bjørsnøs here:
      https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-April/065849.html

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: