Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8352042: [leyden] Parallel precompilation #49

Open
wants to merge 3 commits into
base: premain
Choose a base branch
from

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Mar 14, 2025

For simplicity reasons, our current precompilation code uses effectively single-threaded blocking compiles. Even for simple cases, this makes assembly phase remarkably long. This does not scale well. We need to do precompilations in parallel.

Unfortunately, I haven't found a good way to check that all async compilations are completed, so I introduced a new one.

Additional testing:

  • Ad-hoc precompilation tests
  • Linux x86_64 server fastdebug, runtime/cds

Progress

  • Change must not contain extraneous whitespace
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8352042: [leyden] Parallel precompilation (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 49

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/leyden/pull/49.diff

Using Webrev

Link to Webrev Comment

Sorry, something went wrong.

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 14, 2025

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

@openjdk
Copy link

openjdk bot commented Mar 14, 2025

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

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 14, 2025
@shipilev
Copy link
Member Author

$ ./run-leyden.sh 

# Before

Generated source code for 10001 classes and compiled them in 19221 ms
AOTConfiguration recorded: app.aotconf

real	0m20.195s
user	0m51.408s
sys	0m1.466s

Reading AOTConfiguration app.aotconf and writing AOTCache app.aot
AOTCache creation is complete: app.aot

real	0m25.396s  ; <--- no parallelism
user	0m25.212s
sys	0m0.696s


# After

Generated source code for 10001 classes and compiled them in 19320 ms
AOTConfiguration recorded: app.aotconf

real	0m20.228s
user	0m50.004s
sys	0m1.419s

Reading AOTConfiguration app.aotconf and writing AOTCache app.aot
AOTCache creation is complete: app.aot

real	0m3.672s   ; <--- 6.6x parallelism
user	0m24.634s
sys	0m0.715s

@mlbridge
Copy link

mlbridge bot commented Mar 14, 2025

Webrevs

@rose00
Copy link
Collaborator

rose00 commented Mar 14, 2025

Really nice, thanks. What motivated the type change on CompileTaskAlloc_lock? Some kind of end-of-time effect that broke the mutex grab?

@shipilev
Copy link
Member Author

shipilev commented Mar 14, 2025

What motivated the type change on CompileTaskAlloc_lock? Some kind of end-of-time effect that broke the mutex grab?

We now need wait/notify, so the lock is no longer a pure Mutex, it is Monitor now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants