recently in past couple months, our project’s sync...
# performance
a
recently in past couple months, our project’s sync time has gone from 1-2 mins to upwards of 6 minutes. in some build scans ive noticed quite a gap between time to sync (6 mins) with the last visible task of :`prepareKotlinBuildScriptModel` . i have to assume its the IDE model being built, but the scans completely do not track that gap. is there ways to grab more detailed metrics on why a gradle sync takes 6 mins? the build scans do not actually reveal the gaps or what happens in between each marker
example
i assume between
:jar
and prepare, its configurating projects (fine) but afterwards is concerning
a
Hey, can you provide some more details on your setup and what changed during the last couple months? What versions of Gradle, IDEA, KGP are you using? Did any of those change recently? Can you check if the longer sync times are tied to the upgrade of one of those things?
Taking another look at your screenshot, it seems concerning that up-to-date tasks take quite a long time. Are you using remote Build Cache, such as Develocity? Can you check stats on the performance of the cache and if that has increased? Maybe it’s a networking issue
a
Hey, can you provide some more details on your setup and what changed during the last couple months?
nothing much actually changed in the setup. We use a remote artifactory build cache. Im thinking that what you said
Are you using remote Build Cache
. We dont have visibility in our companies artifactory performance and likely its low performance based. this poiint stuck with me so i moved to offline build configurations to see if it will help. how did you make that jump from a build scan that has no information on that?
apologies for the late reply
a
The task is up-to-date, that means that the task itself didn’t really run. So, it means that it’s the infrastructure of Gradle that took that time. Of course, the infrastructure by itself is not slow (not that slow) and has to be held up by external factors. Networking is one of them. Though, thinking about it more, when the task is
UP-TO-DATE
that means the local state on disk was already correct. It means that it didn’t download the result from cache. It still might have been checking the remote cache, but I don’t know if that would be a blocking operation, before actually checking the local state. Since you have build scans, I’d advise you to take a look at the networking tab, like here: https://ge.gradle.org/s/aikq66l6n4eks/performance/network-activity Another suspect is file locking. It might be possible that other processes, maybe other Gradle builds, were running at the same time. If one of them needed an exclusive access to a shared directory, e.g. under the user home, the other one might need to wait. Hence, the delay. This could also explain why the performance problem is intermittent.
Are you able to consistently reproduce this performance issue?
a
yeah it seems consistent. there is a bit of a gap between the
prepareKotlinBuildScriptModel
and the end to a gradle IDE sync. the IDE shows “building model” , so its building the IDE model. hence my question, if we have visiblity into the performance there and what can affect that
maybe its something I need to run
info
on? but scans dont show what happens here
a
What do the details on the task say about duration?