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

Performance degradation during Gradle configuration phase since version 1.1.6 #405

Open
KarboniteKream opened this issue Jan 31, 2025 · 2 comments

Comments

@KarboniteKream
Copy link

KarboniteKream commented Jan 31, 2025

After upgrading this plugin to version 1.1.6 in our large Gradle project, we noticed that the configuration phase duration went from 1 second to anywhere between 20 and 30 seconds. The issue also happens with version 1.1.7. We're using Gradle 8.4, but I've reproduced the issue with Gradle 8.8.

Looking at the commit history, I suspect it's due to caad92a. If I disable applyMavenExclusions, the performance goes back to normal, but doing that is not desirable for us.

Looking at Gradle's Build Scan of the project, the increased duration comes from "Task graph calculation".

On version 1.1.5 (runs slower with --scan, but in reality it's around 1 second):
Image

On version 1.1.6:
Image

Unfortunately, it's difficult to share reproducible build due the NDA, and if I remove most of the code the overall build duration also decreases. However, I'm willing to help test this in any way I can.

@wilkinsona
Copy link
Contributor

Thanks for the report. From what you've described, I agree that caad92a is the likely cause. The changes were made to fix #384.

Unfortunately, I'm not sure what can be done here to improve the situation. I believe there are two choices:

  1. Use beforeResolve and risk problems with the partial resolution and full resolution disagreeing that may cause Gradle not to execute tasks that should have run. This also triggers a deprecation warning with Gradle 8.8 and is incompatible with Gradle 9.
  2. Use withDependencies as recommended by the Gradle team and suffer the performance hit that you're seeing

Unless there's a third option (@jvandort I'd really welcome your input here please), I think the second option is the better of the two, certainly in the longer term.

but doing that is not desirable for us.

Why is it undesirable? Does it leave you with too many unwanted dependencies that you'd prefer not to exclude through some other means?

@KarboniteKream
Copy link
Author

KarboniteKream commented Jan 31, 2025

Thank you for the fast reply!

Why is it undesirable? Does it leave you with too many unwanted dependencies that you'd prefer not to exclude through some other means?

It's not desirable per se, just not suitable as a quick fix. The performance impact of this is also a significant chunk of the total build time.

For now, we've downgraded to 1.1.5 while I try to figure out what is currently being excluded and whether we can do it in a different way. It's possible there won't be any issues with disabling the Maven exclusions.

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

No branches or pull requests

3 participants