RFR: JDK-8166948: Exploded image too slow to be usable
erik.joelsson at oracle.com
Fri Sep 30 10:20:21 UTC 2016
On 2016-09-30 12:06, Alan Bateman wrote:
> On 30/09/2016 09:03, Erik Joelsson wrote:
>> During the build process, we create an exploded image as an interim
>> step before linking the real JDK and JRE images. This exploded image
>> is used both for running certain build tools during the build but is
>> also used by developers when needing a quick build-test cycle since
>> the exploded image is much faster to build incrementally.
>> Lately, with newer Jigsaw features, the exploded image has become
>> very slow to run. This is caused by the runtime needing to index all
>> packages in all modules at startup. In a linked image, this data is
>> pregenerated, but in the exploded case, it's not. There have been
>> reports of this taking up to 4-5 seconds on certain configurations.
>> To fix this, we can add a new build tool that is run on the exploded
>> image, which updates the module-info.class files with this package
>> index. This will also have the benefit of also speeding up jmod and
>> jlink when run during the build.
>> Alan provided the tool and I have modified the build to use it.
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8166948
>> Webrev: http://cr.openjdk.java.net/~erikj/8166948/webrev.01/
> The build changes looks okay to me. The only thing is that all tools
> using BUILD_JIGSAW_TOOLS are invoked with the same --add-exports, not
> really an issue but I could imagine needing to split those out sometime.
Thanks! The --add-exports are shared at build time but not at runtime.
While I agree it's not strictly correct, I wouldn't really care that
much for a simple build tool.
More information about the build-dev