On Mon, 12 Sep 2022 18:34:12 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:
>> I have been looking into `make clean-images images` performance, and >> realized jmod keeps compressing files with default compression level. Tuning >> that toward lighter compression levels improves build performance >> considerably, without a heavy loss in *.jmod sizes. >> >> This PR allows JMOD to select the compression level. Follow-ups would use >> this in the build system, see #10214. >> >> The interesting asymmetry against `jlink` is: `jlink` provides `--compress` >> option that only takes `2` for "ZIP compression". (Separately, we could >> argue if it would be beneficial to extend `--compress` to `jlink` as well, >> so to select the compression level there too.) > > Aleksey Shipilev has updated the pull request incrementally with one > additional commit since the last revision: > > Adopt "--compress zip-[0-9]" as option format I also like the new `--compress` option taking `zip-0, zip-1,... zip-9` values. src/jdk.jlink/share/classes/jdk/tools/jmod/JmodOutputStream.java line 58: > 56: * returning the output stream to write to the JMOD file. > 57: */ > 58: static JmodOutputStream newOutputStream(Path file, LocalDateTime > date, int compLevel) throws IOException { Suggest to name this parameter `compressLevel` to make it clear. src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java line 171: > 169: Path extractDir; > 170: LocalDateTime date; > 171: int compLevel; s/compLevel/compressLevel/ src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java line 1191: > 1189: if (idx != lastIdx) { > 1190: throw new CommandException("err.compress.incorrect", > value); > 1191: } what about checking `value.substring(0, idx)` is "zip"? test/jdk/tools/jmod/JmodTest.java line 807: > 805: jmod("create", > 806: "--class-path", cp, > 807: "--compress", "test", good to have a test case verifying "test-0" value. ------------- PR: https://git.openjdk.org/jdk/pull/10213