RFR: 8347712: IllegalStateException on multithreaded ZipFile access with non-UTF8 charset

Jaikiran Pai jpai at openjdk.org
Tue Mar 11 14:28:36 UTC 2025


On Tue, 11 Mar 2025 14:23:02 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> The change that was done in Java 15 was a performance optimization. I have verified that the current proposed change in this PR doesn't degrade the performance and yet fixes the reported issue.

The `test/micro/org/openjdk/bench/java/util/zip/ZipFileGetEntry.java` micro benchmark was introduced in Java 15, when that change was done. I have run that benchmark locally on macos before and after the fix proposed in this current PR and I don't see any noticeable difference (which is a good thing):


Before the change in the current PR:

Benchmark                             (size)  Mode  Cnt   Score   Error  Units
ZipFileGetEntry.getEntryHit              512  avgt   15  32.636 ? 1.169  ns/op
ZipFileGetEntry.getEntryHit             1024  avgt   15  36.082 ? 1.437  ns/op
ZipFileGetEntry.getEntryHitUncached      512  avgt   15  51.132 ? 1.241  ns/op
ZipFileGetEntry.getEntryHitUncached     1024  avgt   15  53.466 ? 2.568  ns/op
ZipFileGetEntry.getEntryMiss             512  avgt   15   9.151 ? 0.560  ns/op
ZipFileGetEntry.getEntryMiss            1024  avgt   15   9.330 ? 0.538  ns/op
ZipFileGetEntry.getEntryMissUncached     512  avgt   15  18.173 ? 1.016  ns/op
ZipFileGetEntry.getEntryMissUncached    1024  avgt   15  21.209 ? 1.264  ns/op



After the change in the current PR:

Benchmark                             (size)  Mode  Cnt   Score   Error  Units
ZipFileGetEntry.getEntryHit              512  avgt   15  32.278 ? 0.565  ns/op
ZipFileGetEntry.getEntryHit             1024  avgt   15  35.998 ? 1.807  ns/op
ZipFileGetEntry.getEntryHitUncached      512  avgt   15  54.884 ? 3.452  ns/op
ZipFileGetEntry.getEntryHitUncached     1024  avgt   15  52.919 ? 1.621  ns/op
ZipFileGetEntry.getEntryMiss             512  avgt   15   8.898 ? 0.050  ns/op
ZipFileGetEntry.getEntryMiss            1024  avgt   15   9.184 ? 0.048  ns/op
ZipFileGetEntry.getEntryMissUncached     512  avgt   15  18.388 ? 0.708  ns/op
ZipFileGetEntry.getEntryMissUncached    1024  avgt   15  21.448 ? 0.848  ns/op

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

PR Comment: https://git.openjdk.org/jdk/pull/23986#issuecomment-2714515521


More information about the core-libs-dev mailing list