Status Update
Comments
wd...@google.com <wd...@google.com>
je...@google.com <je...@google.com>
ly...@gmail.com <ly...@gmail.com> #2
I've also filled an issue in android-cache-fix repo:
Unfortunately, I can't share build logs of our project because of NDA.
I've tried to reproduce it on fenix application from firefox-android repo: ./gradlew :app:testDebugUnitTest --tests="org.mozilla.fenix.AppRequestInterceptorTest" --build-cache --scan
, here are build scan:
Here are durations:
Duration 0.958s Task action execution 0.024s Fingerprinting inputs 0.001s Build cache 0.870s
And build cache result:
Cache key 7e478d2218e4a6d0ed6bc60fdcde092f Cache artifact 17.9 MiB / 2 entries Pack 0.870s
As we can see here, packing a cache of the task output took longer than task execution. And the size of file app/build/intermediates/apk_for_local_test/fenixDebugUnitTest/apk-for-local-test.ap_
is 27.9 MB on a disk. And this is the only one module. With a large number of modules in the project, and a large number of changes being merged every day, the cache size of only this task output could reach tens of gigabytes on the remote server after a few days.
iv...@gradle.com <iv...@gradle.com> #3
Hi, following this issue, we have measured the duration of the task in different scenarios. We covered different Remote Cache Nodes. local cache, execution and task without cache. We used the project Signal, the PackageForUnitTest task generates an output of 15 Mb.
Results(ms):
executed_cache_disabled | executed | local cacje | remote cache us-east | remote cache europe-west | asia-south | |
---|---|---|---|---|---|---|
mean | 197 | 2214 | 331 | 725 | 1149 | 2053 |
p25 | 188.25 | 2083 | 326 | 567 | 1114 | 1715 |
p50 | 195 | 2162 | 327.5 | 624 | 1159 | 1799 |
p75 | 207.1 | 2287.8 | 328 | 739.2 | 1257.2 | 1854 |
p90 | 235.6 | 2540.4 | 367.1 | 1342.8 | 1335 | 4199.8 |
p99 | 238 | 2574 | 383 | 1440 | 1339 | 4783 |
hu...@google.com <hu...@google.com> #4
Thank you for these reports and analyses!
We have fixed this issue in AGP 8.3.0-alpha01:
(I'm not able to cherry-pick the fix into AGP 8.2 because we have many cherry-picks already, and this issue can probably be worked around by writing a small build script.)
jb...@gmail.com <jb...@gmail.com> #5
Tnx
Description
The output of
PackageForUnitTest
is anapk-for-local-test.ap_
file containing resources and assets of all dependencies of a particular module. In large projects, each.ap_
file takes a lot of disk space on the remote build cache server (up to 30-40 megabytes for app modules or modules with a lot of dependencies); This task is performed very quickly, so I think that caching is redundant here.AGP version: 8.0.2