RFR: 8293499: Provide jmod compression level option
Alan Bateman
alanb at openjdk.org
Thu Sep 8 13:38:40 UTC 2022
On Thu, 8 Sep 2022 07:57:36 GMT, Aleksey Shipilev <shade at 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.
>
> This change nominally requires CSR, but I would like to gauge the reaction to this patch first, before submitting a formal CSR. The interesting asymmetry against `jlink` is: `jlink` provides `--compress` option that only takes `2` for "ZIP compression". I would argue it would be beneficial to add `--compression-level` to `jlink` as well, so to select the compression level there too.
I don't have time to look at this closely today but I think an option to configure the compression level wouldn't look out of place on the jmod tool.
Doing the equivalent with jlink would require more thought to see if it makes sense or is really needed. The jimage format is for execution, not a packaging format like jmod that is primarily consumed at link-time. I agree the jlink --compress option is a bit overloaded where --compress=0 and --compress=2 are more like jar --no-compress or its default to deflate. The jar tool doesn't have an option to set the compression level.
-------------
PR: https://git.openjdk.org/jdk/pull/10213
More information about the core-libs-dev
mailing list