On Thu, 8 Sep 2022 08:08:54 GMT, Aleksey Shipilev <[email protected]> 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/

I think the idea of being able to change the jmod compression is good. I'm torn 
about what a good default is. Maybe keeping a higher compression on release 
builds would make sense?  I'm not sure so would like to hear if there are more 
opinions on it. There is little point spending time compressing jmods on debug 
builds at least.

make/autoconf/jdk-options.m4 line 481:

> 479: AC_DEFUN_ONCE([JDKOPT_SETUP_JMOD_OPTIONS],
> 480: [
> 481:   AC_ARG_WITH(jmod-compress, [AS_HELP_STRING([--with-jmod-compress],

I would recommend using UTIL_ARG_WITH here instead. I would also prefer if the 
default was specified in configure (using the DEFAULT argument to 
UTIL_ARG_WITH) so that it's visible in the help output and printed in the 
configure log for user transparency.

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

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

Reply via email to