

How We Shaved 11 Seconds Off Cold Builds.
The build engine started at 12 seconds per cold build. Fourteen months later six rewrites, two hardware swaps, one argument about Rust vs Zig we're at 0.84 seconds. Here's every decision that mattered, ranked by how much time it actually saved.
December 2024. A teammate ran forge build on the main branch and got up to make coffee. By the time he sat back down, the build had finished but the espresso machine was still warming up. Twelve seconds. We thought this was fine. Vite users would have laughed at us. Webpack users would have envied us. We sat in an uncomfortable middle.
The first ticket I wrote that quarter was three sentences:
"Cold builds are too slow. Under one second by April. No new headcount." Maya approved it the same afternoon.
Caching is cheating, and that's fine.
The single most impactful change wasn't an algorithm. It was admitting that most builds are mostly the same as the last build. We hashed every artifact modules, bundles, the entire dependency graph and stored them in a content-addressable cache shared between teammates.
The math was embarrassingly good. On a typical day, 96% of a build's outputs were identical to something we'd built before. We were doing the same work over and over because nobody had told the build system to stop.
The first build of the day is always slow. The 47th is what you measure.
— Maya Okafor, internal review, Jan 2025
The shared cache shipped in Lumen 1.8 in January 2025. Cold build dropped from 12s to 4.2s. Three months in, we'd already saved ourselves the cost of a small CI plan. The team did a small "we did it" lunch. The lunch was the bug we thought we were done.

The Rust rewrite (or: how to lose three months and gain ten seconds).
By spring we were stuck. The graph walker, the type-checker, and the bundler were all TypeScript. We were paying the V8 startup tax on every cold build about 600ms before our code did anything useful. We rewrote the language server in Rust. This was the unpopular decision; Sam Liu and I argued about it for three weeks.
The bad news: it took 14 weeks instead of the 6 we'd estimated. The good news: it shipped at 2.6 seconds.

What the Rust rewrite actually bought us
600ms saved by killing the V8 startup tax on cold runs
~40% lower memory at idle, which mattered more than we expected on contributor laptops
Easier parallelism, because Rust's ownership model genuinely is a productivity feature once you stop fighting it
The pull request that landed the rewrite was 47,000 lines. Nobody reviewed it line-by-line. We reviewed the design doc, the test plan, and we ran it on a hundred real codebases in CI for six weeks before merging. That's the only reason a 47,000-line PR is acceptable.
Most performance wins aren't smarter algorithms. They're the boring decision to stop doing the same work twice.
Parallelism, taken seriously.
The graph walker was single-threaded for embarrassingly long. We were running on 14-core machines and using one. The fix wasn't subtle we wrapped the topological walk in rayon's parallel iterator and watched our test runs go from 2.6s to 1.6s. Eleven cores of stranded compute, just sitting there. The non-trivial part was making the cache thread-safe without serializing every write. We landed on a shared lock-free map with one lock per 256 entries. Full write-up here; the short version is that we benchmarked seven designs and the simplest one won.
Letting the AI plan the build.
By autumn we'd done all the obvious work. The remaining time wasn't waiting on the CPU it was waiting on which module to compile next. The graph walker picked nodes in topological order, but that's not always the order that minimises total wall time.
We trained a small model on a year of build telemetry. It predicts, given the change set, which modules are about to be needed and which ones can be deferred. It runs locally on the same Rust binary, takes 14ms, and reorders the work queue. We were skeptical it would help. It helped a lot.
The AI optimizer shipped in Lumen 2.4 in May 2026. Median cold build dropped from 1.6s to 0.84 seconds. The first time I saw it under one second I clapped, out loud, in my apartment. Then I went and looked at the p99 it was 2.1s, which was fine.
The final numbers, fully honest.
p50 cold build: 0.84s. This is the headline number, and it's real.
p99 cold build: 2.1s. We have a plan to bring this down. We have not finished it.
Hot build: 38ms. Most of this is filesystem watch overhead. We're stuck here.
Memory at idle: 184MB. Was 612MB on v1.6.
Cache hit rate: 98.4% on average across all teams, weighted by build count.
If you want to reproduce these, the benchmark repo is public. Every number in this post is from ./run.sh --milestones; nothing here is from a marketing dashboard.

















