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

Eirik Bjorsnos duke at openjdk.org
Thu Feb 9 10:57:41 UTC 2023


On Thu, 9 Feb 2023 10:05:06 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> Should be a win and avoids the need for a new mismatch method here.

Interestingly, this is not a win:

PR:


Benchmark                             (size)  Mode  Cnt    Score   Error  Units
ZipFileGetEntry.getEntryHit              512  avgt   15   73.633 ± 4.349  ns/op
ZipFileGetEntry.getEntryHit             1024  avgt   15   74.477 ± 1.667  ns/op
ZipFileGetEntry.getEntryHitUncached      512  avgt   15  108.352 ± 1.598  ns/op
ZipFileGetEntry.getEntryHitUncached     1024  avgt   15  110.425 ± 1.867  ns/op
ZipFileGetEntry.getEntryMiss             512  avgt   15   21.921 ± 0.251  ns/op
ZipFileGetEntry.getEntryMiss            1024  avgt   15   22.836 ± 0.279  ns/op
ZipFileGetEntry.getEntryMissUncached     512  avgt   15   51.890 ± 2.289  ns/op
ZipFileGetEntry.getEntryMissUncached    1024  avgt   15   56.722 ± 0.701  ns/op


Claes:


BBenchmark                             (size)  Mode  Cnt    Score   Error  Units
ZipFileGetEntry.getEntryHit              512  avgt   15   84.518 ± 4.440  ns/op
ZipFileGetEntry.getEntryHit             1024  avgt   15   85.359 ± 1.484  ns/op
ZipFileGetEntry.getEntryHitUncached      512  avgt   15  117.003 ± 1.481  ns/op
ZipFileGetEntry.getEntryHitUncached     1024  avgt   15  119.026 ± 1.073  ns/op
ZipFileGetEntry.getEntryMiss             512  avgt   15   22.027 ± 0.188  ns/op
ZipFileGetEntry.getEntryMiss            1024  avgt   15   22.929 ± 0.282  ns/op
ZipFileGetEntry.getEntryMissUncached     512  avgt   15   52.513 ± 1.859  ns/op
ZipFileGetEntry.getEntryMissUncached    1024  avgt   15   56.425 ± 0.699  ns/op


(I forced ZipCoder.compare here by simply removing UTFZipCoder.compare)

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

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



More information about the security-dev mailing list