perf(android): parallelize Gradle build + raise heap to fit build timeout#2432
perf(android): parallelize Gradle build + raise heap to fit build timeout#2432WcaleNieWolny wants to merge 1 commit into
Conversation
… set The Android cloud build (ee.forgr.capacitor_go, ~140 Capacitor plugin modules) was being cancelled at the 15-minute Capgo build timeout during compile/dexing. gradle.properties was under-resourced for that scale: - org.gradle.parallel was commented out → 140 modules built serially - org.gradle.jvmargs=-Xmx1536m → low heap, GC pressure on a huge build Enable parallel module builds, raise the daemon heap to 4 GB, and turn on the build cache. These are safe, non-degrading speedups (minifyEnabled is already false, so no R8/shrink change) that should bring the build under the timeout. Cloud builder runners are multi-core with ample RAM. Complements raising the app's build_timeout_seconds; either or both get the build to complete.
Merging this PR will not alter performance
Comparing Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR updates Gradle build configuration settings in ChangesGradle Build Performance Optimization
🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|



What
Optimize
android/gradle.propertiesso the large multi-plugin Android build completes faster:org.gradle.parallel=true(was commented out → 140 plugin modules built serially)org.gradle.jvmargs:-Xmx1536m→-Xmx4096m -XX:MaxMetaspaceSize=1024morg.gradle.caching=trueWhy
The Android cloud build for
ee.forgr.capacitor_go(~140 Capacitor plugin modules) is deterministically cancelled at the 15-minute mark — that's the app's Capgobuild_timeout_seconds = 900. All code blockers are fixed (manifest merge, FileProvider, etc.); the build reaches compile + D8 dexing and runs out of time (runs 26942004595 on12.159.6and 26946186506 on12.159.7, both cancelled at ~19–20 min total / ~15 min build time).minifyEnabledis alreadyfalse, so R8 minification isn't the cost — it's compiling + dexing 140 modules. But the build config was under-resourced for that scale: no parallelism and only a 1.5 GB heap. Enabling parallel module builds and a larger heap are safe, standard speedups (no change to the release artifact) that should bring the build comfortably under the timeout. Cloud builder runners are multi-core with ample RAM (ubuntu-latest ≈ 16 GB).Relationship to the timeout
This complements raising the app's Build Timeout (dashboard setting) — either one (or both) can get the build to complete:
Test plan
Build mobile android; confirm the build finishes (AAB produced) within the timeout, and that parallel build + 4 GB heap don't OOM the runner.Summary by CodeRabbit