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

Relax synchronization in Mojos #25

Closed
jhonnen opened this issue Apr 9, 2021 · 3 comments · Fixed by #27
Closed

Relax synchronization in Mojos #25

jhonnen opened this issue Apr 9, 2021 · 3 comments · Fixed by #27
Milestone

Comments

@jhonnen
Copy link
Contributor

jhonnen commented Apr 9, 2021

https://bugs.eclipse.org/bugs/show_bug.cgi?id=571434
https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=285635

Currently most (all?) tycho Mojos synchronize on a static lock, effectively allowing only different goals to run in parallel.
Especially the (relatively) long-running compile and package mojos spend more time waiting for the lock than doing actual work in a build with 32 threads.

Maven only recommends that pessimistic lock pattern "if a mojo uses a known-non-threadsafe external dependency" [1].
AFAICS that's not the case. Removing the locks speeds up a mvn clean package -T 2C (=32) a lot: 18min vs 1h before.
See the attached comparison.

[1] https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3

@mickaelistria
Copy link
Contributor

Thanks for the patch.
Do you want to keep this issue open to track further improvements or do you prefer that we close it?

@jhonnen
Copy link
Contributor Author

jhonnen commented Apr 9, 2021

Those two mojos were just the low hanging fruits. I'll try to check the other mojos next week.

@jhonnen
Copy link
Contributor Author

jhonnen commented Apr 12, 2021

Apart from those two mojos, only the P2MetadataMojo blocks for some significant (but much less) time in our build. But there's a lot going on and I can't quite guarantee its threadsafety.
I don't have the time to dig deeper ATM, so I'll close this issue for now.

@jhonnen jhonnen closed this as completed Apr 12, 2021
@laeubi laeubi added this to the 2.4 milestone Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants