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

To fork or not to fork (javac) #30451

Closed
ywelsch opened this issue May 8, 2018 · 2 comments · Fixed by #30462
Closed

To fork or not to fork (javac) #30451

ywelsch opened this issue May 8, 2018 · 2 comments · Fixed by #30462
Labels
:Delivery/Build Build or test infrastructure >enhancement Team:Delivery Meta label for Delivery team

Comments

@ywelsch
Copy link
Contributor

ywelsch commented May 8, 2018

In order to speed up compilation on CI I think we should stop forking the java compiler. My tests on a 6 core machine show that this could give us a 2x speed-up.

Not forking for compilation:

./gradlew clean compileJava compileTestJava
5m 11s

./gradlew clean compileJava compileTestJava --parallel
2m 59s

Forking for compilation:

./gradlew clean compileJava compileTestJava
1m 55s

./gradlew clean compileJava compileTestJava --parallel
1m 26s

The code where we do forking has the comment

// we fork because compiling lots of different classes in a shared jvm can eventually trigger GC overhead limitations

but I have not seen such issues. If we run ./gradlew clean compileJava compileTestJava --parallel in a separate build step (for example in elasticsearch-ci), then this should pose no issue. We could also make this a configurable thing (-Pfork.compiler=false) so the fast mode can be enabled for people that want faster compilation.

@ywelsch ywelsch added >enhancement :Delivery/Build Build or test infrastructure labels May 8, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@ywelsch ywelsch changed the title To fork or not to fork To fork or not to fork (javac) May 8, 2018
@jasontedor
Copy link
Member

I raised #30462.

@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure >enhancement Team:Delivery Meta label for Delivery team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants