-
Notifications
You must be signed in to change notification settings - Fork 46
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
build time increased after updating from plugin version 4.1.2 to 4.2.x #932
Comments
Without more information it will be difficult to tell what is going on. There can be multiple factors contributing to this. Note that we just releases 4.3.0 that you might also want to try. Can you tell which tasks take time configuring? What tasks are you invoking? Any chance you can share build scans? |
@melix our current observation is that locally the simplest task (e.g. a But that's really just to demonstrate that something is going on there during configuration. On CI/CD, this config time is about 6 additional minutes before each bigger step using running gradle tasks (static code checks, tests, etc.), that adds up in the end. regarding 4.3.0 - already tried it, but got the following error for multiplatform modules when I start using this version:
happens with any task I want to run |
Unfortunately the "old profile" is way too limited to debug anything. The error you are seeing with 4.3 is also unexpected, but it may hint at an issue with your build itself, which may trigger eager configuration of tasks when it shouldn't. I do not exclude a regression in our build plugins but since we're not seeing that in other projects, it's a bit puzzling... |
Could you maybe create a minimal reproducer which would mimic your build? It looks like you have a particular setup with Kotlin multiplatform, so it may be related. |
@melix we're seeing errors in non-multiplatform (but multi-module) projects too on 4.3.0. the interesting part of the stacktrace could be this one probably:
|
This doesn't tell much unfortunately, except that the problem happens in |
my problem happens in a dead simple JVM multimodule project, it has nothing to do with multiplatform, and we've also seen the performance penalty between 4.1 and 4.2 |
Then really, please, provide a minimal reproducer. I tried with a simple multiproject build generated by GCN and I cannot reproduce any configuration time issue, so I suspect it's the way you apply the plugins or configure your build which triggers eager configuration of tasks. see https://scans.gradle.com/s/ac7t4d7fg27ck/performance/build for example. |
I am experiencing the same issue in a multi-module java project with about 40 sub-modules. It started after upgrading micronaut from 4.1.2 to 4.2.4 (and gradle from 8.1.1 to 8.5). After some profiling I think gradle/gradle#25226 is causing it as can be seen by the flame graph below. Anyway, I have no idea why it started now as it seems the gradle issue is present since 8.1.1 at least, or if there is any change that can be made to my configuration to fix this. |
I tested the gradle fix and indeed it improves a lot the configuration time, in my project from ~40s to ~6s. I don't know if it is a configuration issue on my side, but it is still slow after the fix because I also tested a modification to the plugin in which the micronaut catalog libraries are cached and the time was reduced to ~1s. |
I can confirm that the issue is in Gradle's version catalog APIs. I'm going to check if I can workaround the problem. |
This commit introduces a cache for the version catalog lookups. It appears that Gradle's findLibrary method is extremely inefficient, causing dramatic build time increases, in particular in multiproject setups. The fix isn't great though, since it involves a static cache, but for now there's no better API until Gradle 8.7 is shipped. Even so, ideally there should be an API to get the library coordinates directly. See gradle/gradle#27444 See gradle/gradle#25226 Fixes #932
This commit introduces a cache for the version catalog lookups. It appears that Gradle's findLibrary method is extremely inefficient, causing dramatic build time increases, in particular in multiproject setups. The fix isn't great though, since it involves a static cache, but for now there's no better API until Gradle 8.7 is shipped. Even so, ideally there should be an API to get the library coordinates directly. See gradle/gradle#27444 See gradle/gradle#25226 Fixes #932
This commit introduces a cache for the version catalog lookups. It appears that Gradle's findLibrary method is extremely inefficient, causing dramatic build time increases, in particular in multiproject setups. The fix isn't great though, since it involves a static cache, but for now there's no better API until Gradle 8.7 is shipped. Even so, ideally there should be an API to get the library coordinates directly. See gradle/gradle#27444 See gradle/gradle#25226 Fixes #932
Issue should be (mostly) fixed in Gradle plugin 4.3.2, released earlier today |
Expected Behavior
the build takes the same (or less) amount of time after plugin version upgrade
Actual Behaviour
we have a pretty big multi-module project where build time increased significantly after updating the Gradle plugins to version 4.2.1 from 4.1.2. Our CI/CD build time went up from ~20 mins to ~50. Local builds also got slower, although not that drastically, but for example the simplest task also takes at least 30 secs (was < 1s before), because the configuration phase takes several seconds.
Steps To Reproduce
No response
Environment Information
Local:
CI/CD:
Example Application
No response
Version
Plugin v4.2.1, Micronaut v4.2.4
The text was updated successfully, but these errors were encountered: