RFR: 8321620: Optimize JImage decompressors

Glavo duke at openjdk.org
Fri Dec 8 22:43:34 UTC 2023


This PR significantly speeds up decompressing resources in Jimage while significantly reducing temporary memory allocations in the process.

This will improve startup speed for runtime images generated using `jlink --compress 1` and `jlink --compress 2` .

I generated a runtime image containing javac using `jlink --compress 1 --add-modules jdk.compiler` and tested the time it took to compile a simple HelloWorld program 20 times using `perf stat -r20 javac /dev/shm/HelloWorld.java`, this PR reduces the total time taken from 17830ms to 13598ms (31.12% faster).

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

Commit messages:
 - getStringMUTF8
 - Small optimization
 - use Byte.toUnsignedInt
 - opt decompressFlow
 - Delete CompressIndexes.readInt(DataInputStream)
 - opt StringSharingDecompressor
 - opt ZipDecompressor

Changes: https://git.openjdk.org/jdk/pull/16556/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16556&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8321620
  Stats: 210 lines in 7 files changed: 70 ins; 60 del; 80 mod
  Patch: https://git.openjdk.org/jdk/pull/16556.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16556/head:pull/16556

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


More information about the core-libs-dev mailing list