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

Claes Redestad claes.redestad at oracle.com
Fri Apr 17 11:33:41 UTC 2020


Hi,

please review this patch to get rid of the back-to-back lookup of name
and name+'/' in ZipFile.getEntry. This is done by first adjusting the
hash function so that a trailing slash is not included in an entry's
hash code, and adjusting appropriately when matching the arrays.

This means we do fewer table lookups, less arithmetic and potentially
less allocation on lookup misses.

Patch contributed by Eirik Bjørsnøs.

Webrev: http://cr.openjdk.java.net/~redestad/8242959/open.00/
Bug:    https://bugs.openjdk.java.net/browse/JDK-8242959

Testing: tier1+2, verified neutral performance for hits and a
significant reduction in cost of misses (~30-50ms improvement on
Spring PetClinic startup).

Thanks!

/Claes


More information about the core-libs-dev mailing list