Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Wealthfront Engineering 6 min read Case study mediumAdept

Tuning Android build nodes for maximum throughput

Wealthfront's Android team tuned Gradle on m7i.8xlarge EC2 Jenkins nodes (32 cores, 128GB) by bounding memory across nested layers: daemon jvmargs, org.gradle.workers.max, test-task maxHeapSize, maxParallelForks and Jenkins executors, whose product must fit in RAM with headroom for the daemon. They use single-use daemons on CI for build isolation and lower memory overhead, and cap workers at max(4, cores/2) because the default of one worker per core caused memory issues. Going from 4 to 8 workers improved unit-test build time, but 8 to 16 changed almost nothing since parallelism is limited by project modularization. Fixed constraints are Xmx10g for Android Lint and 4g test heaps.

Assumes: Gradle basicsJVM heap settingsJenkins CI

Related posts

  • The Sentry Android SDK is now 20-30% faster!

    Sentry mediumAdept

    Sentry's Android SDK init time dropped 20-30% between versions 8.43.0 and 8.54.0, alongside reduced memory allocation, fixed leaks and up to 10% less background CPU. The team found bottlenecks with Perfetto traces and validated over 40 changes with Android Macrobenchmark on a clock-locked Pixel 3. Highlighted changes: the Gradle plugin writes manifest options and class-availability checks into bytecode at build time, avoiding manifest parsing and reflection (6.5% gain); a custom DSN parser replaces java.net.URI (6ms down to 1µs); and one-off threads move to shared executor pools, saving 3MB of heap from ART's 1MB thread stacks. Upgrading to SDK 8.54.0+ and Gradle plugin 6.20.0+ is enough to get the gains.

  • Counting to 3 with a new builder processing 50M+ monthly builds

    Railway mediumAdept

    Railway replaced its docker-buildx-on-GCP-VMs build system with Builder v3: 256-vCPU bare-metal hosts split into eight 32-vCPU microVM build cells running buildkitd, scheduled with a 1-of-3 ring to keep BuildKit caches warm, now peaking at 66,000 builds per hour. Collapsing a host/guest split (workflow → gRPC over vsock → guest handler) into one standalone builder process cut about 20 seconds from cached builds. Rollout problems included VM bridge networking failures that forced a rollback, unreliable DNS (fixed with embedded CoreDNS), clock drift breaking cert validation, and stuck builds from runc workers starving buildkitd, fixed with cgroup v2 slices. Reading layer metadata from OCI manifests instead of decompressing layers was about 15× faster and saved roughly 10 seconds per build.

  • Mobile Developer Experience at Slack

    Slack Engineering mediumAdept

    A dedicated mobile Developer Experience team grew from 3 to 8 engineers and cut CI feedback time and failure rates by targeting the pain points that surveys, NPS and metrics like time to merge showed hurt developers most. iOS test time fell from about 50 minutes to an average of 9 by moving from Xcodebuild to Bazel with disk caching and bazel-diff, so only affected targets are tested. On Android, test sharding (in-house Fuel, later Flank) cut runs from 50+ minutes to under 20, and replacing Calabash with Espresso took suites from ~350 to ~60 minutes. Further gains came from auto-suppressing flaky tests (failure rate 57% to 4%), migrating from Jenkins to Buildkite (CI stability ~87% to 95%, TTM down 41%), generating Xcode projects with Xcodegen to avoid merge conflicts, and adopting a merge queue.

  • Accelerate Your Docker Builds Using AWS CodeBuild and Docker Build Cloud

    Docker mediumAdept

    Offloading container image builds from AWS CodeBuild to Docker Build Cloud addresses three common CI bottlenecks: undersized build machines, no persistent layer cache in clean CI environments, and slow emulated multi-architecture builds. A buildspec.yml installs the latest Buildx, logs in to ECR and Docker with a PAT from Secrets Manager, selects a cloud builder, and runs `docker buildx build --platform linux/amd64,linux/arm64 --push` straight to ECR. On a 2 vCPU/3GB CodeBuild instance, the build dropped from 5:59 for an AMD64-only local build to 1:04 for a native AMD64+Arm64 build, using 16 vCPU/32GB builders and a 200 GiB shared cache.

  • Deploying to production in <5m with our hosted container builder

    incident.io mediumAdept

    incident.io cut Docker image build times from an inconsistent 3–10+ minutes back to under 2 minutes by replacing CircleCI's remote Docker and Docker Layer Caching with a permanently running GCP c2-standard-8 builder with a 500GB SSD. The slow builds came from CircleCI's DLC attaching a cache disk only when one is free, so concurrent builds often started with a cold layer cache. Larger CircleCI resource classes added minutes of provisioning time. CircleCI jobs now reach the dedicated daemon over SSH via DOCKER_HOST. Measured builds take 20s with no changes and about 1m50s when both the Go backend and React frontend change, for roughly £350/month.

The quest for software engineering knowledge.

Look:
Layout: