Skip to content

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

Engineering@Microsoft 4 min read Case study easyNovice

Large-scale distributed builds with Microsoft Build Accelerator

Microsoft's BuildXL distributes and caches builds for its largest codebases. Runtime file access monitoring fails the build whenever a process reads unpredicted inputs or writes conflicting outputs, which makes incremental builds trustworthy enough to ship from. Its key caching change is a two-phase cache lookup: the fingerprint combines statically predicted inputs with dynamically observed ones, such as the subset of headers a C++ compiler actually reads. This avoids both over-approximated inputs and hand-maintained dependency annotations. Together with CloudBuild, it cut builds that took over 24 hours down to minutes, at the scale of millions of process invocations.

Related posts

  • Improving machine learning iteration speed with faster application build and packaging

    Meta Engineering mediumAdept

    Meta cut ML engineers' build and packaging overhead by double-digit percentages by tackling build non-determinism, pruning dependencies, and replacing monolithic XAR executables with an incremental Content Addressable Filesystem (CAF). Non-determinism from compilers and build rules is mitigated inside the Remote Execution service that Buck2 sends nearly all build actions to, so stable warm revisions can reuse cached outputs. CAF describes each executable as a flat manifest of content digests, skips uploads already in CAS, and fetches only missing content via per-host CAS daemons that share data peer-to-peer over Owl. Btrfs compression and copy-on-write keep on-disk size close to XAR while sharing files across executables. Planned next steps are lazy on-demand fetching (LazyCAF) and putting all ML engineers on uniform revisions to raise cache hit rates.

  • The quest for the five minute deploy

    incident.io mediumAdept

    incident.io cut CI/CD times by moving from a hosted provider, where a cold Go build cache made compiling 15,000+ tests across 350+ packages the bottleneck, to Buildkite running on three self-hosted 48-vCPU servers. Prebuilding Ginkgo test binaries and running them in batches on a single server, plus per-server Go build caches, per-yarn.lock Node module caches with pipeline fallback, and local Docker image caches, brought the test step to 2–4 minutes. Production deploys fell from 11.5 to 8.5 minutes, branch builds from 10 to 5.5, and hotfixes to 3.5. Remaining pain points include bin packing containers, under-provisioned disk IOPS, newly exposed flaky tests, cache poisoning, zombie containers, and a fast-growing cache that must be cleared wholesale.

  • Speeding up C++ build times

    Figma mediumAdept

    Figma halved C++ build times by attacking the volume of preprocessed bytes sent to the compiler, which had grown far faster than the codebase. Manually pruning unnecessary includes in the largest files cut compiled bytes 31% and cold builds 25%, motivating two automated tools: DIWYDU, a libclang-Python AST checker that flags headers a file doesn't directly use, and includes.py, a fast Clang-free script that estimates transitive bytes per source file and warns on PRs that regress it. Per-directory Fwd.h files centralize forward declarations so headers avoid heavy includes, and Bazel remote caching shaved over two minutes off local builds; together the tools catch 50-100 potential slowdowns daily.

  • Copy-on-Write performance and debugging

    Engineering@Microsoft mediumAdept

    Testing Dev Drive with copy-on-write (block clone) linking across large internal Microsoft repos showed build-time reductions up to 43%, with many repos gaining 10% or more. C# repos with deep project-to-project dependencies and builds that copy files into microservice layouts benefited most, while C++-heavy repos and builds ending in long linear dependency chains gained little. Practical tips cover spotting CoW links with fsutil queryExtentsAndRefCounts, allowing ProcMon and Xperf filter drivers on Dev Drive, and using refsutil leak to clean up orphaned references that hit ReFS's 8176-clone-per-block limit. CoW becomes automatic in Windows 11 24H2 and Server 2025; until then, add the CopyOnWrite SDK to MSBuild repos.

  • Build better software to build software better

    Slack Engineering mediumAdept

    Slack cut the 60-minute build pipeline for Quip and Slack Canvas's backend by applying classic software engineering principles (hermetic, idempotent, granular units of work and clean separation of concerns) before adopting Bazel. A dependency edge from the built Python backend into the TypeScript frontend build zeroed the cache hit rate and cost about 35 minutes per build. The team untangled build code from application code, rewrote orchestration in Starlark, cut Python build scripts down to the standard library only, and used a Rust diffing tool to verify the new artifacts matched the old ones. The core lesson is that Bazel's caching and parallelism only pay off once the build graph is acyclic, well-defined and finely granular.

The quest for software engineering knowledge.

Look:
Layout: