# How Grab is Blazing Through the Superapp Bazel Migration

[Grab](https://yomu.fyi/company/grab) · Sergii Grechukha · Dec 3, 2020

**Type:** Problem & solution

## Summary

Grab's mobile superapp scaled past 2.5 million lines of code across both Android and iOS, leading to unsustainable local and CI build times under Gradle and Xcode. To address these bottlenecks, the engineering team analyzed their dependency trees and introduced an internal tool to calculate and optimize the build critical path. They also deployed a Kubernetes-autoscaled remote build system using Mainframer for Android and implemented Test Impact Analysis to run only affected tests in pre-merge validation. While dependency decoupling yielded modest 7% to 10% gains and iOS remote builds proved unscalable on Apple hardware, Android remote builds reduced local compile times by up to 50%, and targeted test execution reduced pre-merge pipeline durations by more than 30%.

## Context

Grab's Android and iOS applications exceeded 2.5 million lines of code with over 1,000 modules and 700 targets, causing clean local builds and pre-merge CI test pipelines to take hours.

## Approach / What changed

The team created a tool to identify and shorten dependency critical paths, built an autoscaling remote execution system with Mainframer for Android, and introduced Test Impact Analysis on CI to execute only tests affected by code changes.

## Takeaways

- Optimizing and decoupling the dependency tree along the critical path reduced CI and local build times by only 7% to 10%, primarily flattening future growth trends.
- A Kubernetes-autoscaled remote execution setup using Mainframer cut Android local build times by 40% to 50%, whereas remote builds for iOS proved unscalable due to Apple hardware constraints.
- Applying Test Impact Analysis to pre-merge CI pipelines cut executed test volume by up to 90% and shortened overall pipeline duration by more than 30% without degrading quality.

**Tags:** [Android](https://yomu.fyi/topic/android), [CI/CD](https://yomu.fyi/topic/ci-cd), [Developer Experience](https://yomu.fyi/topic/developer-experience), [iOS](https://yomu.fyi/topic/ios), [Testing](https://yomu.fyi/topic/testing)

[Read original post](https://engineering.grab.com/how-grab-is-blazing-through-the-super-app-bazel-migration)
