Automating Android Build Benchmarking with Gradle Profiler
Article Summary
Doni Winata from Traveloka's Android Infra team reveals how his team automated build benchmarking to catch performance regressions before they hit production. For projects with 300+ modules and 15-20 minute build times, manual benchmarking isn't an option.
Benchmarking Android builds is notoriously tricky due to cache states, daemon conditions, and project size. Doni's team integrated Gradle Profiler with Gradle Enterprise on their CI/CD pipeline to automate the entire process, enabling daily monitoring and regression detection without blocking developer machines.
Key Takeaways
- Gradle Profiler automates benchmarking by running multiple build iterations with warm-ups
- CI/CD integration saves time: benchmark 300+ module projects without blocking local machines
- Gradle Enterprise dashboard filters builds by scenario, branch, and tags for easy comparison
- Four key scenarios monitored daily: full build, incremental, clean build, and R8/minify
- Caught real regressions: R8 build slowdown from debuggable setting and memory leaks
Automating build benchmarks with Gradle Profiler and Gradle Enterprise enabled Traveloka to monitor daily builds, compare branches effortlessly, and catch performance regressions that would otherwise slip through.
About This Article
Traveloka's Android project has over 300 modules, which makes build performance unpredictable. Cache states, daemon conditions, and project size all affect how accurately they can benchmark and measure consistency.
Doni Winata's team set up parameterized scenario files in Gradle Profiler. These files specify warm-ups, worker counts, and task configurations. They then fed the results into Gradle Enterprise and added custom tags so they could filter by scenario name and profiler phase.
Their daily automated monitoring caught a real problem where R8 build times got slower after the Android Gradle Plugin 7.2 changed the debuggable setting to false. This let them analyze the root cause quickly by comparing build scans.