Add true configuration cache support for git commit hash#2285
Add true configuration cache support for git commit hash#2285fire-light42 merged 18 commits intorecloudstream:masterfrom
Conversation
|
@fire-light42 would it be possible to get this reviewed and (hopefully) merged? That way we can also hopefully move forward with #2249 at some point as well. |
|
@fire-light42 sorry for the ping again on this but any chance to review and potentially merge? |
There was a problem hiding this comment.
I very much like your solution with assets!
However it caches the git commits too much. Creating a commit while developing and then rerunning the app will lead to incorrect git commit in app.
I changed some code to include the HEAD and refs/heads files as input files, which will make the job re-run when those files change.
I am no Gradle expert but it seems to work well in my testing. What do you think?
Co-authored-by: firelight <147925818+fire-light42@users.noreply.github.com>
|
@fire-light42 I think this should be okay now? |
|
@fire-light42 sorry for the ping on this again, and I know there is probably more important things, but any chance this can be merged soon? I am kinda just wanting to clear out my local branches before working on to much more. |
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:
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.