-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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 scripts should be compiled in parallel #9225
Comments
This is a good thought. As is including the compilation time of the @eriwen Actually, have you considered including the compilation time for the build in the buildscan? |
Compilation time is captured, at least for build scripts. Example: https://scans.gradle.com/s/h2ily574bqb4g/performance/configuration |
Sorry, you're correct, It seems build scans do include compilation of build scripts. I have here a build scan from my production project where we migrated our build scripts to the kotlin dsl. I simply ran https://scans.gradle.com/s/umqht4zx6m3vk/performance/configuration Is there a reason the build scripts cannot be compiled in parallel? |
Related to gradle/kotlin-dsl-samples#902 |
Can this be prioritized? |
Would this also result in parallel compilation of non-Kotlin In AndroidX, our build scans indicate that the time to compile our build.gradle's for the first build is also about 18.5s ( https://scans.gradle.com/s/dzeucmd457i2e/performance/configuration?openScriptsAndPlugins=WyJjb2RlLXVuaXQtOmJ1aWxkc3JjIWJ1aWxkLmdyYWRsZSIsImNvZGUtdW5pdC1idWlsZC5ncmFkbGUiXQ#summary-script-compile ) . |
@mathjeff The groovy scripts generally take less than 10 milliseconds to compile. One reason for the long compile time in that build scan you shared is that the build is not using a Gradle Daemon and therefore takes longer to start up. |
That's interesting. I'm running with the daemon disabled mostly because that's the way our CI is set up for maximum reproducibility, which does give us slower builds |
We're suffering from this in the Kotlin project itself. Every time we upgrade the bootstrap Kotlin compiler version, which happens pretty often, or someone changes anything in |
@udalov use composite builds instead : https://proandroiddev.com/stop-using-gradle-buildsrc-use-composite-builds-instead-3c38ac7a2ab3 |
@kaushalyap Thanks for the link! I don't think this will help in the mentioned case of upgrading the bootstrap Kotlin compiler though, since we actually need to recompile everything, including buildscripts, with the new dependencies. |
I came across this issue and had a workaround for it. The idea is based on Now, the biggest drawback of this approach is that the management overhead is huge. In IntelliJ, you potentially can see lots of modules in your Gradle view and the project view, which can also potential decrease IDE performance, but in my mind, it is worth to accept such high overhead to gain the build speed improvement from 2:30 to 1:42 (tested using |
@CXwudi, this issue is about build scripts, not precompiled scripts |
@eskatos I know but I think the same idea could be applicable |
Is this by any chance on the roadmap? |
Hi @NikolayMetchev, yes, we're not ready to commit to having this feature in a specific Gradle release yet but it is part of our active plan for improved IDE sync performance (isolated projects). |
Thanks @bamboo Good luck and thanks for your hard work. |
Related (albeit with a more general summary): #8538 |
When changing something in the buildSrc all
build.gradle.kts
must be recompiled. From the command line interface output, it looks like all thebuild.gradle.kts
files are compiled sequentially instead of in parallel. This can slow down builds especially for large projects.Expected Behavior
Expect build.gradle.kts files to compile in parallel if those modules can compile in parallel.
Steps to Reproduce
Run .gradlew assemble in
multi-kotlin-project-with-buildSrc
. Noticebuild.gradle.kts
files compiling sequentially.Change something in
buildSrc/src/main/kotlin/utils.kt
, noticebuild.gradle.kts
files recompile sequentially.I would include a build scan, but build scans don't include buildSrc compilation.
The text was updated successfully, but these errors were encountered: