Making Turborepo 96% faster with agents, sandboxes, and humans vercel.com
Anthony Shew on eight days of optimising Turborepo’s Rust codebase with background agents, and what the humans in the loop were actually for. The measured thing throughout is Time to First Task, the task graph computation Turborepo does before it starts running any of your work, not build time. Between v2.8.0 and v2.9.0 that dropped from 8.1 seconds to 716 milliseconds on Vercel’s largest monorepo of around 1,000 packages, which is 91% faster. Smaller repositories gained less: 81% at 132 packages, 80% at six.
The 96% in the title is a ceiling rather than a result. Testing against open source repositories and customer canaries, Shew found improvement could get as high as 96% depending on the size and complexity of the repository. Worth holding the baseline in mind before repeating the number.
The method is the interesting part. Turborepo emits profiles as JSON in Chrome Trace Event Format, so he added a crate that writes a companion Markdown file alongside every trace, on the reasoning that a format he struggles to read is not one an agent will do well with either. Agents then read the profile, proposed hotspots, and implemented changes; he picked which to pursue and validated each with clean benchmarks in an isolated Sandbox. Individual wins were ordinary in size, around 25% of wall-clock time from one PR and 6% from another, compounding over the week.
His description of running them is memorable: I spun up 8 background coding agents from my phone before bed, each targeting a different part of the Rust codebase. He also notes that merged improvements shaped later agent behaviour, since your own source code is the best reinforcement learning out there. This is Vercel writing about Vercel’s tools on Vercel’s repository, so read the sandbox pitch accordingly. Give your agent a laboratory makes the same case for building the measurement harness first.