Skip to content

Conversation

@Luna712
Copy link
Contributor

@Luna712 Luna712 commented Dec 2, 2025

This prevents the configuration cache from rebuilding every single time there is a new commit, which can drastically improve build performance, especially when there are no Kotlin files changed. I tested this on pre release builds, once with no files changed that is in the build (just changing GitHub workflows) and pre release built in 38 seconds. The second time, I tried just changing an XML resource and it built in about 2 minutes. Third time changing a Kotlin file (which requires recompiling it all) and it ran in about 6 minutes, which is still drastically faster than without configuration cache at all.

There were other ways to do this, I tried numerous ways including:

  1. Have it generate a strings resource file, but this method requires resources be rebuilt every single build, which from my testing takes about 45 seconds.
  2. Have it generate a Kotlin file that can just access a field from it, but this requires Kotlin to rebuild every single time even if no Kotlin files are changed, which takes about 4 minutes of extra build time when no other Kotlin files are changed.

Using an asset only requires merging new assets every single time which only takes about 3 seconds which is very performant and allows other gradle features aimed at speeding up build to work and allow ensuring that files that don't need rebuilding aren't. This prevents the reclaculating of configuration cache every new commit allowing it to work properly. Runtime performance seems to not be affected at all when reading the asset rather than a resValue. Seems to have no affect at runtime.

This needs to be combined with #2249 to have much impact here on the GitHub builds though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant