Skip to content

Commit 7f3a88f

Browse files
committed
Move to using GRPC to fetch cache entries from GCP
Local testing shows that it drops sequential download time by ~40% Compare: Before patch: https://ge.androidx.dev/scans/performance?performance.metric=buildCacheOverhead%2CbuildCacheOverheadDownload&search.startTimeMax=1758610799999&search.startTimeMin=1758317400000&search.tags=nonGrpc&search.tasks=assemble&search.timeZoneId=America%2FLos_Angeles&search.usernames=aurimas After patch: https://ge.androidx.dev/scans/performance?performance.metric=buildCacheOverhead,buildCacheOverheadDownload&search.startTimeMax=1758610799999&search.startTimeMin=1758316800000&search.tags=not:nonGrpc&search.tasks=assemble&search.timeZoneId=America%2FLos_Angeles&search.usernames=aurimas Going from 13m 1s to 7m 54s in sequential download time. Test was running the following in androidx checkout: rm -fr ../../out/.gradle/caches/build-cache-1/ && rm -fr ../../out/androidx && ALLOW_PUBLIC_REPOS=true ./gradlew -p compose assemble --dependency-verification=off
1 parent 96c1622 commit 7f3a88f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

gcpbuildcache/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ gradlePlugin {
5555
id = "androidx.build.gradle.gcpbuildcache"
5656
displayName = "Gradle GCP Build Cache Plugin"
5757
description = """
58-
- Graduating to 1.0.0 stable version.
58+
- Move to using GRPC to fetch cache entries from GCP. Local testing shows that it drops sequential download time by ~40%
5959
""".trimIndent()
6060
implementationClass = "androidx.build.gradle.gcpbuildcache.GcpGradleBuildCachePlugin"
6161
tags = listOf("buildcache", "gcp", "caching")
@@ -64,7 +64,7 @@ gradlePlugin {
6464
}
6565

6666
group = "androidx.build.gradle.gcpbuildcache"
67-
version = "1.0.0"
67+
version = "1.0.1"
6868

6969
testing {
7070
suites {

gcpbuildcache/src/main/kotlin/androidx/build/gradle/gcpbuildcache/GcpStorageService.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,11 @@ internal class GcpStorageService(
173173
) ?: return null
174174
val retrySettings = RetrySettings.newBuilder()
175175
retrySettings.maxAttempts = 3
176-
return StorageOptions.newBuilder().setCredentials(credentials)
176+
return GrpcStorageOptions.newBuilder().setCredentials(credentials)
177177
.setStorageRetryStrategy(StorageRetryStrategy.getUniformStorageRetryStrategy()).setProjectId(projectId)
178178
.setRetrySettings(retrySettings.build())
179-
.setTransportOptions(transportOptions)
179+
.setEnableGrpcClientMetrics(false)
180+
.setAttemptDirectPath(false)
180181
.build()
181182
}
182183

0 commit comments

Comments
 (0)