The Ledger
ENGINEERING

How we cut build times in half without changing the stack

Every engineering team eventually hits the same wall: the build that used to take ninety seconds now takes nine minutes, and nobody can point to the exact moment it happened. Ours was no different. What started as a quick afternoon investigation turned into a three-week audit of every assumption we'd made about our pipeline.

The instinct, when builds get slow, is to reach for bigger machines or to start ripping out tooling in favor of whatever the newest framework promises. We resisted both urges. Instead, we asked a simpler question: where is the time actually going, and is any of it necessary?

Start by measuring, not guessing

We instrumented every stage of the pipeline — dependency resolution, compilation, bundling, test execution, and artifact upload — and logged timings for two weeks across every branch in the repository. The data surprised us. Compilation, the stage everyone assumed was the bottleneck, accounted for less than twenty percent of total wall-clock time. The real cost was hiding in redundant dependency installs and a test suite that re-ran unaffected packages on every single commit.

"We didn't need a faster compiler. We needed to stop doing work we'd already done."

Once we had the data, the fixes were almost embarrassingly simple: a shared cache keyed on lockfile hashes, a dependency graph that let us skip unaffected test suites, and a small change to how we parallelized the upload step. None of it required a new stack, a new language, or a new vendor. It required paying attention.

Six weeks after the first measurement pass, our median build time had dropped from nine minutes to just under four. No migrations, no rewrites — just the discipline to measure before we changed anything.