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

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

    XMLWordPrintable

Details

    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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: