toolbox
toolbox copied to clipboard
Cache Gradle service response for all Gradle versions
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.
We added an experimental flag to do some performance comparison (see https://github.com/gradle-plugins/toolbox/pull/80).
The change we did in #80 is not enough. At least we can now see the network activity in the build scan:

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.
Another experimentation for performance: https://github.com/gradle-plugins/toolbox/pull/84
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.
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.
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.