RFR: 8293532: Use lighter jmod compression levels in build config [v2]
Aleksey Shipilev
shade at openjdk.org
Tue Sep 20 19:00:45 UTC 2022
On Tue, 20 Sep 2022 15:00:48 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> As follow-up to [JDK-8293499](https://bugs.openjdk.org/browse/JDK-8293499), JDK build can stick to lighter jmod compression levels to gain build performance.
>>
>>
>> # ----- Baseline
>> $ time CONF=linux-x86_64-server-release make clean-images images
>> real 0m10.762s
>> user 1m5.157s
>> sys 0m12.370s
>>
>> $ du -sk build/linux-x86_64-server-release/images/jdk/jmods/
>> 81480 build/linux-x86_64-server-release/images/jdk/jmods/
>>
>> $ time CONF=linux-x86_64-server-release make clean-images images
>> real 0m9.574s
>> user 1m2.644s
>> sys 0m12.143s
>>
>> $ du -sk build/linux-x86_64-server-release/images/jdk/jmods/
>> 85744 build/linux-x86_64-server-release/images/jdk/jmods/
>>
>>
>> This gets even more substantial if JVM is configured with `--with-native-debug-symbols=internal`, in which case `java.base` includes a much larger `libjvm.so`:
>>
>>
>> # Baseline
>> $ time CONF=linux-x86_64-server-release make clean-images images
>> real 0m36.617s
>> user 1m30.216s
>> sys 0m11.692s
>>
>> $ du -sk build/linux-x86_64-server-release/images/jdk/jmods/
>> 295428 build/linux-x86_64-server-release/images/jdk/jmods/
>>
>> # Patched
>> $ time CONF=linux-x86_64-server-release make clean-images images
>> real 0m22.183s
>> user 1m13.841s
>> sys 0m11.657s
>>
>> $ du -sk build/linux-x86_64-server-release/images/jdk/jmods/
>> 316856 build/linux-x86_64-server-release/images/jdk/jmods/
>>
>>
>> Users can use `--with-jmod-compress=zip-6` to get the original JMOD compression level back. Or, they can give up on compression altogether using `--with-jmod-compress=zip-0`, and then reap even more time benefits:
>>
>>
>> $ time CONF=linux-x86_64-server-release make clean-images images
>> real 0m6.411s
>> user 0m56.145s
>> sys 0m12.278s
>>
>> $ du -sk build/linux-x86_64-server-release/images/jdk/jmods/
>> 183752 build/linux-x86_64-server-release/images/jdk/jmods/
>
> Aleksey Shipilev has updated the pull request incrementally with three additional commits since the last revision:
>
> - Typos
> - GHA should use the zip-1 level across all builds
> - Move detection and defaults to configure, select compression based on release/debug
All right then. See new commits:
- release builds with `zip-6` (default) -- still improves a bit, because interim jmods are not compressed
- fastdebug builds with `zip-1` -- favoring speed over disk size
- GHA release/fastdebug build with `zip-1` -- to gain build perf without incurring too much network/storage overhead;
Sample improvements for `make clean-images images`:
# Linux x86_64 release
# Baseline
real 0m10.583s
user 1m3.106s
sys 0m11.806s
# Patched
real 0m10.430s
user 1m2.314s
sys 0m11.678s
# Linux x86_64 fastdebug
# Baseline
real 0m17.388s
user 2m47.504s
sys 0m17.616s
# Patched
real 0m15.713s
user 2m41.490s
sys 0m20.843s
-------------
PR: https://git.openjdk.org/jdk/pull/10214
More information about the build-dev
mailing list