RFR: 8340571: Outline code from the loop in ZipFile.Source.initCen
Claes Redestad
redestad at openjdk.org
Mon Sep 23 09:50:05 UTC 2024
This PR suggests refactoring `ZipFile.Source.initCEN` to move as much logic as possible into the per-entry method processor. This inner method will be called often and JIT optimized earlier in the bootstrap sequence.
Startup tests using the OpenJDK benchmarks.jar show a ~1ms improvement on both my M1 macbook and my x64 wokstation, while we also improve on relevant throughput microbenchmarks:
Name (size) Cnt Base Error Test Error Unit Change
openCloseZipFile 512 15 61372.449 ± 1197.432 58081.423 ± 1751.988 ns/op 1.06x (p = 0.000*)
openCloseZipFile 1024 15 117953.727 ± 3202.274 112548.875 ± 5126.665 ns/op 1.05x (p = 0.001*)
openCloseZipFilex2 512 15 62141.795 ± 674.121 60520.017 ± 2438.346 ns/op 1.03x (p = 0.017 )
openCloseZipFilex2 1024 15 117959.071 ± 1528.426 111773.937 ± 1604.412 ns/op 1.06x (p = 0.000*)
* = significant
-------------
Commit messages:
- Further tuning, avoid unnecessary long conversions
- Fix after merge
- Merge optimization rework
- Cleanup, further micro-optimization
- Extract a state object and call that in a loop, shifting work from initCEN to checkAndAddEntry
- Use zero as ZIP_ENDCHAIN marker to avoid the Arrays.fill
- Avoid loading TreeSet
- Going all the way
- merge master
- Use zero as ZIP_ENDCHAIN marker to avoid the Arrays.fill
- ... and 5 more: https://git.openjdk.org/jdk/compare/ab06a878...19f33b8b
Changes: https://git.openjdk.org/jdk/pull/21133/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21133&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8340571
Stats: 152 lines in 2 files changed: 65 ins; 47 del; 40 mod
Patch: https://git.openjdk.org/jdk/pull/21133.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21133/head:pull/21133
PR: https://git.openjdk.org/jdk/pull/21133
More information about the core-libs-dev
mailing list