RFR: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos [v7]

Eirik Bjorsnos duke at openjdk.org
Thu Feb 9 11:20:43 UTC 2023


On Thu, 9 Feb 2023 11:07:17 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> Could be interesting to see if special-casing `startsWith` to call `equals` when possible would help:

It helps... a lot!


Benchmark                             (size)  Mode  Cnt    Score   Error  Units
ZipFileGetEntry.getEntryHit              512  avgt   15   72.800 ± 3.426  ns/op
ZipFileGetEntry.getEntryHit             1024  avgt   15   73.434 ± 0.671  ns/op
ZipFileGetEntry.getEntryHitUncached      512  avgt   15  107.538 ± 1.309  ns/op
ZipFileGetEntry.getEntryHitUncached     1024  avgt   15  110.775 ± 2.252  ns/op
ZipFileGetEntry.getEntryMiss             512  avgt   15   22.022 ± 0.170  ns/op
ZipFileGetEntry.getEntryMiss            1024  avgt   15   23.242 ± 1.569  ns/op
ZipFileGetEntry.getEntryMissUncached     512  avgt   15   50.946 ± 0.458  ns/op
ZipFileGetEntry.getEntryMissUncached    1024  avgt   15   57.856 ± 3.021  ns/op

-------------

PR: https://git.openjdk.org/jdk/pull/12290



More information about the security-dev mailing list