Skip to content

8387377: Compilation is very slow when --module-path contains many Automatic Modules and ALL-MODULE-PATH is used.#31755

Open
lahodaj wants to merge 2 commits into
openjdk:masterfrom
lahodaj:JDK-8387377
Open

8387377: Compilation is very slow when --module-path contains many Automatic Modules and ALL-MODULE-PATH is used.#31755
lahodaj wants to merge 2 commits into
openjdk:masterfrom
lahodaj:JDK-8387377

Conversation

@lahodaj

@lahodaj lahodaj commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Automatic modules have requires transitive directives to all other automatic modules. When computing the transitive readability set, javac follows all these directives, for all the modules. When there's a high number of automatic modules, this can take a long time, as for each automatic module, javac does the full loop through all the other automatic modules.

This PR is attempting to improve the situation in two ways:

  • the transitive readability computation is computed directly for automatic modules, avoiding the repeated analysis of automatic module dependencies.
  • the pre-existing transitive readability cache is filled and used a bit more directly.

The enclosed test which uses 1_000 automatic modules is running in ~1s on my computer with this change; times out without it.



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Warning

 ⚠️ Found trailing period in issue title for 8387377: Compilation is very slow when --module-path contains many Automatic Modules and ALL-MODULE-PATH is used.

Issue

  • JDK-8387377: Compilation is very slow when --module-path contains many Automatic Modules and ALL-MODULE-PATH is used. (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31755/head:pull/31755
$ git checkout pull/31755

Update a local copy of the PR:
$ git checkout pull/31755
$ git pull https://git.openjdk.org/jdk.git pull/31755/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31755

View PR using the GUI difftool:
$ git pr show -t 31755

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31755.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jul 2, 2026

Copy link
Copy Markdown

👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jul 2, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added the compiler compiler-dev@openjdk.org label Jul 2, 2026
@openjdk

openjdk Bot commented Jul 2, 2026

Copy link
Copy Markdown

@lahodaj The following label will be automatically applied to this pull request:

  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jul 2, 2026
@mlbridge

mlbridge Bot commented Jul 2, 2026

Copy link
Copy Markdown

Webrevs

@davidalayachew

Copy link
Copy Markdown
Contributor

Thank you thank you so much! This will make development much easier. Plus, having this work will make migration much easier for other projects too.

Automatic Modules are a critical first step for projects that want to dip their toes into going fully modular. Adding the Automatic-Module-Name to a jar's MANIFEST.MF is an easy first step to get most of the benefits of going modular, and an important stabilizing point. But, that also requires the ALL-MODULE-PATH to make it usable from the start. Without it, it just takes too much effort to enumerate every transitive Automatic Module that is not being pulled in by your direct dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler compiler-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants