GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Keep forked Java compilers around after a build if requested by octylFractal · Pull Request #21034 · gradle/gradle

Conversation

@octylFractal

@octylFractal octylFractal commented Jun 16, 2022

Copy link
Copy Markdown
Member

This results in significant performance improvements when repeatedly running builds by allowing us to re-use the JITed code from the already running java processes. A simple benchmark I ran locally using largeJavaMultiProject shows a 32% improvement on average for abiChange, and a 52% (!) improvement for cleanAssemble.

The benchmarks can be found attached, they were run on the latest nightly (7.6-20220615224043+0000) and this branch which was near the same commit as the nightly.

benchmarks.zip

I would like to get a confirmation from the @gradle/bt-execution team that there are no known problems with this. Otherwise, this seems like a fairly straightforward performance win to me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@octylFractal octylFractal added a:feature A new functionality in:java-plugins java-library, java, java-base, java-platform, java-test-fixtures labels Jun 16, 2022
@octylFractal octylFractal added this to the 7.6 RC1 milestone Jun 16, 2022
@octylFractal
octylFractal requested review from a team June 16, 2022 21:25
@octylFractal octylFractal self-assigned this Jun 16, 2022
@ijuma

ijuma commented Jun 17, 2022

Copy link
Copy Markdown
Contributor

Something similar was done for Scala recently, but it relies on a configuration instead of changing the default #20580

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lptr

lptr commented Jun 17, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

We haven't done this yet for a number of reasons, despite the obvious benefits.

If we want to keep compiler (or other) forked processes running between builds (=forked daemons), then we need better memory and child-process management. Users might end up with multiple Gradle daemons starting many forked daemons that end up taking up all the available memory. There needs to be a way to detect and kill forked daemons that somehow got in a deadlock, or developed a memory leak, too. It would be great if we could share forked daemons between Gradle daemons, too, though that's not a strict dependency of rolling this out.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lptr

lptr commented Jun 17, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Taking a step back, I think doing the benchmark is already a step forward. We now moved from our anecdotal/self-convinced confidence about the potential improvements we could get by doing this, and confirmed/quantified it with a benchmark.

One option could be to do something similar to Scala, and allow users to enable the long-lived compiler daemons already. I think we need to be careful here, though, as doing so can lead to hard to debug problems. But it would be good to get some user feedback about how useful this could be in the field, so putting this behind a feature flag might be something we could do. I would only do this, though, if we are actually planning to implement the memory/child-process management features soon after.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@big-guy big-guy modified the milestones: 7.6 RC1, 8.0 RC1 Jun 29, 2022
@lptr
lptr removed the request for review from a team August 1, 2022 09:04
@ijuma ijuma mentioned this pull request Aug 22, 2022
Re-use compiler daemons between builds #13274
Closed
@big-guy big-guy removed this from the 8.0 RC1 milestone Oct 21, 2022
@github-actions

github-actions Bot commented Dec 20, 2022

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be closed if no further activity occurs. If you intend to work on this pull request, please ask the team to reopen the PR or push a new PR. Thank you for your contributions.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale label Dec 20, 2022
@octylFractal octylFractal removed the stale label Dec 27, 2022
octylFractal added 2 commits April 3, 2023 09:48
@octylFractal
Keep forked Java compilers around after a build
b33f6f5
@octylFractal
Move DaemonJavaCompiler keep alive to an internal property
e36795c
@octylFractal
octylFractal force-pushed the ot/feature/keep-java-compiler-around branch from 27ce800 to e36795c Compare April 3, 2023 20:35
tresat
tresat reviewed Apr 3, 2023
View reviewed changes
Comment thread ...ts/language-java/src/main/java/org/gradle/api/internal/tasks/compile/DaemonJavaCompiler.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@octylFractal
Use IllegalState and original exception in DaemonJavaCompiler
c840f21
@octylFractal
octylFractal requested a review from tresat April 4, 2023 16:14
tresat
tresat approved these changes Apr 4, 2023
View reviewed changes
@octylFractal

octylFractal commented Apr 5, 2023

Copy link
Copy Markdown
Member Author

@bot-gradle test and merge

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bot-gradle

bot-gradle commented Apr 5, 2023

Copy link
Copy Markdown
Collaborator

No milestone for this PR. Please set a milestone and retry.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@octylFractal octylFractal modified the milestones: 8.3 RC1, 8.2 RC1 Apr 5, 2023
@octylFractal

octylFractal commented Apr 5, 2023

Copy link
Copy Markdown
Member Author

@bot-gradle test and merge

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gradle gradle deleted a comment from octylFractal Apr 5, 2023
@bot-gradle

bot-gradle commented Apr 5, 2023

Copy link
Copy Markdown
Collaborator

I've triggered a build for you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bot-gradle
bot-gradle merged commit abbc465 into master Apr 5, 2023
@bot-gradle
bot-gradle deleted the ot/feature/keep-java-compiler-around branch April 5, 2023 06:23
@octylFractal octylFractal changed the title Keep forked Java compilers around after a build Keep forked Java compilers around after a build if requested Apr 13, 2023
@ijuma ijuma mentioned this pull request Dec 21, 2023
MINOR: Use --no-daemon when building with Jenkins apache/kafka#15057
Closed
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tresat tresat tresat approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@octylFractal octylFractal

Labels

a:feature A new functionality in:java-plugins java-library, java, java-base, java-platform, java-test-fixtures

Projects

None yet

Milestone

8.2 RC1

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@octylFractal @ijuma @lptr @bot-gradle @tresat @big-guy
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.