toolbox icon indicating copy to clipboard operation
toolbox copied to clipboard

Cache Gradle service response for all Gradle versions

Open lacasseio opened this issue 3 years ago • 6 comments

We cache the first query to the service but we don't cache across Gradle invocation. We can see a performance hit on the build on every configuration. We should try to see if we can use the Gradle's project.getResources().getText().fromUri(...) which support caching.

lacasseio avatar Jan 19 '22 17:01 lacasseio

We added an experimental flag to do some performance comparison (see https://github.com/gradle-plugins/toolbox/pull/80).

lacasseio avatar Jan 20 '22 23:01 lacasseio

The change we did in #80 is not enough. At least we can now see the network activity in the build scan:

Screen Shot 2022-01-20 at 9 23 31 PM

However, the query time is about 0.3s on each configuration. We should try to avoid network access completely. Maybe configuration cache could solve this issue.

lacasseio avatar Jan 21 '22 02:01 lacasseio

Another experimentation for performance: https://github.com/gradle-plugins/toolbox/pull/84

lacasseio avatar Jan 21 '22 14:01 lacasseio

Regardless of what we use there are about .5 seconds just for head check. I think we should try to differ the checks to as late as possible. At least it would be when we actually need to task. The unfortunate side effect is one could declare coverage for Gradle 9.42 and it would create the tasks without failing. Users would only see the failure during execution time which is fair.

lacasseio avatar Jan 21 '22 14:01 lacasseio

The text resource is annoying as it's unavailable from the Settings plugin. Regardless, we should use the service and deal with Settings plugin as a different issue.

lacasseio avatar Jul 17 '24 19:07 lacasseio

Regarding the performance issue, we could solve it by creating the task using a rule and when we detect an active IntelliJ sync is active. The main issue is resolving Gradle versions because we need to know the latest/minimum, and minor Gradle versions.

lacasseio avatar Jul 17 '24 19:07 lacasseio