Skip to content

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

Engineering@Microsoft 5 min read Case study mediumAdept

Copy-on-Write performance and debugging

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.

Assumes: MSBuildWindows file systems

Related posts

  • Large-scale distributed builds with Microsoft Build Accelerator

    Engineering@Microsoft easyNovice

    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.

  • The pursuit of an autonomic scale and efficiency system for Microsoft 365: Making it as easy as breathing

    Engineering@Microsoft easyNovice

    Microsoft 365's Cloud Profiling and Reporting Pipeline continuously profiles 1000+ services, capturing CPU, allocations, rooted and duplicated memory, exceptions, IO, GC pause stacks and blocking latency. It feeds that production data back to engineers through Visual Studio code lens cost trends, Roslyn analyzers for efficient patterns, and pull request bots that comment on efficiency opportunities. Anomaly detection over the dataset flags code-level resource regressions through heatmaps and routes them into incident tooling. A flame-graph viewer supports shared issue tagging and trending over time. The stated goal is a self-optimizing cloud that eventually uses AI tools like PerfLens to fix inefficient code automatically.

  • 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.

  • 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.

  • Improve Git monorepo performance with a file system monitor

    GitHub Engineering mediumAdept

    Git 2.37.0 adds a builtin file system monitor daemon (`git fsmonitor--daemon`) for macOS and Windows, enabled by setting `core.fsmonitor` to true. The daemon registers for OS change notifications and keeps an in-memory, time-sorted queue of changed paths. Git commands query it over IPC using tokens that carry the daemon PID and a resync ID, so dropped events trigger a safe full rescan. Combined with `core.untrackedcache`, it cuts `git status` on Chromium and synthetic 1M/2M-file worktrees from 17–85 seconds to under one second by shrinking the refresh_index and untracked-file phases, which also speeds up `git diff`, `git add` and `git checkout`.

The quest for software engineering knowledge.

Look:
Layout: