This message was deleted.
# caching
s
This message was deleted.
👀 1
l
What tasks are worth for developers to pull, but not for CI?
g
Thanks for replying! These are the tasks, ordered by the percentage of executions that have negative savings (we gathered it from the Enterprise API) It's not that we know they're not worth pulling in local builds, it's that we don't have a reliable measuring. On CI, Gradle Enterprise estimates savings from remote hits, but this metric isn't valid for local builds as I understand it. Since only CI stores cache entries, it'd be comparing local pull time vs. original CI execution time, which is quite different from local execution time (varying location, network quality, competing processes, etc.). That's why we thought of disabling caching only in CI, where we know they're not worth it
We actually already disabled caching completely for these tasks on CI with
cacheIf { !isCI }
as I described, letting local builds re-execute and cache them locally. However, it's presumably what caused our local build time (p95) to increase, due to cache misses
l
Yeah,
cacheIf { !isCI }
seems like an anti-pattern, and can very well cause increased build times due to cache misses. But why do you think they are worth caching locally? The local cache is predominantly useful when switching branches or moving around in the history by some other means (like
git bisect
). It’s impact should be far smaller than that of the remote cache. I’d assume that if a task is not worth caching on CI, it is safe to assume that it’s not worth caching locally either?
In any case, we are planning some improvements in this area for your specific use case. I can’t say when we are going to ship them, but negative savings is a problem we’d like to fix for most builds as part of the planned improvements.
g
That's good to hear! About assuming that a task not worth caching on CI is also not worth it on local, it's probably safe to assume one from the other when a task is presumably not worth caching due to the nature of its work (e.g. for being disk-heavy), or when you've actively measured the difference.