Turborepo Is Now 96% Faster, Vercel's AI Agent Experiment

Turborepo Is Now 96% Faster, Vercel's AI Agent Experiment

lschvn5 min read

Vercel engineers spent a week in March 2026 using AI coding agents to optimize Turborepo's Rust task scheduler. The result: task graph computation is now 81 to 96% faster, depending on repository size. On a 1,000-package monorepo, turbo run went from 10 seconds of overhead to feeling near-instant. The write-up is worth reading for anyone working on high-performance JavaScript tooling.

Starting With Unsupervised Agents

The experiment began with eight background coding agents, each targeting a different area of the Rust codebase. Each agent was given a loosely defined goal, find performance issues, without step-by-step guidance. By morning, three had produced usable results: a 25% wall-clock reduction by switching to reference-based hashing, a 6% win from replacing the twox-hash crate with xxhash-rust, and a cleanup of an unnecessary Floyd-Warshall algorithm.

But the engineers quickly identified a pattern: agents produced impressive microbenchmarks that didn't translate to real-world gains. One agent cranked out a "97% improvement" on a microbenchmark that amounted to 0.02% in practice. Agents never wrote regression tests. They never used the --profile flag. And critically, they benchmarked against synthetic targets rather than the actual Turborepo codebase.

The Profiling Problem

When the team tried using standard Chrome Trace JSON profiles with the agents, the results were poor. Function names split across lines, irrelevant metadata mixed with timing data, not grep-friendly. The agents fumbled through these files the same way a human would, badly.

The breakthrough came from noticing that Bun had shipped a --cpu-prof-md flag that generates profiles as Markdown. The Vercel team created a turborepo-profile-md crate that outputs companion .md files alongside every trace: hot functions sorted by self-time, call trees by total-time, caller/callee relationships, all greppable, all on single lines.

The difference was immediate. Same model, same codebase, same harness. Just a different format. The agents suddenly produced dramatically better optimization suggestions.

What Actually Got Faster

The human-guided iteration loop, profile, identify hotspots, propose, implement, validate with hyperfine, ran for four days and produced over 20 PRs. The wins fell into three categories:

Parallelization. Building the git index, walking the filesystem for glob matches, parsing lockfiles, and loading package.json files were all sequential. These are now concurrent. The gains were largest for repositories with many packages.

Allocation elimination. The pipeline was cloning entire HashMaps when references would do. Glob exclusion filters were recompiled on every invocation instead of being pre-compiled. Each HTTP client was constructed per request instead of being reused. These small copies added up.

Syscall reduction. Per-package git subprocess calls were batched into a single repo-wide index. Then git subprocesses were replaced with libgit2, and libgit2 was in turn replaced with gix-index, a faster, pure-Rust implementation.

The Limit: 85% Was the Ceiling

At 85% faster, progress stalled. The remaining gains were within measurement noise on the engineers' MacBooks. The team suspects the issue was benchmarking methodology rather than the code itself, as operations get faster, variance from system noise (disk I/O, CPU scheduling) overwhelms the signal.

The lesson: your source code is the best feedback loop. Agents that had previously written poor code would, in later sessions, produce better output, not because the model changed, but because the merged improvements were now visible in the codebase and the agents followed them. Context, it turns out, is still the key ingredient.

What This Means for the JavaScript Tooling Ecosystem

Turborepo is foundational infrastructure for a large share of the JavaScript monorepo world. Speed improvements here compound across every turbo run build, turbo run test, and turbo run lint in every repo that depends on it. The fact that the optimization was driven by AI agents, but validated by humans, is a realistic picture of where AI-assisted engineering is in 2026: a powerful accelerator for finding wins, still dependent on human judgment to separate signal from noise.

The Markdown profiling format is already being discussed as a potential standard for LLM-readable performance output across Rust tooling projects.

Frequently Asked Questions

Related articles

More coverage with overlapping topics and tags.

Google Cloud's Open Knowledge Format Is a Standard, Not a Product: A Deep Dive Into OKF v0.1
ai

Google Cloud's Open Knowledge Format Is a Standard, Not a Product: A Deep Dive Into OKF v0.1

On June 12, 2026, Google Cloud published the Open Knowledge Format (OKF), an open specification that formalizes the LLM-wiki pattern into a portable, interoperable format: a directory of markdown files with YAML frontmatter, one required field (type), five recommended ones, and zero required tooling. The tweet from Google Cloud Tech on June 16 drove 117,000 views in 24 hours and made the spec the most-discussed knowledge-format launch of the year. This long read walks through the v0.1 spec section by section, the design choices that make it deliberately minimal, what Google is shipping alongside it (an enrichment agent for BigQuery, a static HTML visualizer, three sample bundles, and a native BigQuery Knowledge Catalog integration), and the open question every AI agent builder and data platform team should be tracking over the next six months.
SpaceX Buys Cursor for $60 Billion: A Deep Dive Into the Biggest AI Coding Deal of the Year
ai

SpaceX Buys Cursor for $60 Billion: A Deep Dive Into the Biggest AI Coding Deal of the Year

On June 16, 2026, four trading days after SpaceX's record $85.7bn IPO made Elon Musk the world's first trillionaire, the company confirmed it will acquire Anysphere, the parent of the Cursor AI coding editor, in an all-stock deal valued at $60 billion. The price is roughly 16x Cursor's late-2025 private valuation, twice the round it was about to close, and the deal closes the loop on a curious April arrangement in which SpaceX had the right to buy Cursor for $60bn or pay $10bn for the partnership instead. This long read walks through the deal mechanics, the IPO-as-acquisition-currency story, the technology bet on Composer + Colossus, what xAI's collapse had to do with the timing, and the questions every developer who uses Cursor, Claude Code, Copilot, or any other AI coding tool should be asking this week.
Staan, the First European Search API, Opens Self-Service: A Deep Dive
ai

Staan, the First European Search API, Opens Self-Service: A Deep Dive

On June 15, 2026, at VivaTech, the Staan search API opened self-service to any developer. It is the public face of European Search Perspective, the 50/50 Qwant and Ecosia joint venture that runs the European search index, and the launch lands in the gap left by Microsoft's August 2025 retirement of the Bing Search API and Google's constrained programmatic access. This long read walks through the pipeline, the three product tiers, the pricing, the sovereignty story and its limits, the 'American backup' fallback, and what it means for the AI agents and coding tools that depend on a fresh web index.

Comments

Log in Log in to join the conversation.

No comments yet. Be the first to share your thoughts.