The Ledger

Engineering

How we cut build times in half without changing the stack

For the better part of two years, our CI pipeline got a little slower every month. What began as a four-minute build had crept past twenty-two, and every stand-up carried the same ritual complaint: push the branch, wait, lose the thread of what you were doing, come back twenty minutes later. We assumed the cure would be expensive — a new build system, a fleet of bigger runners, maybe a full monorepo migration. It turned out to be none of those things.

Over six weeks this spring, we brought the median build from 22 minutes to 9 and the p90 from 31 to 13. We did it with the same stack, the same CI provider, and the same test suite. The only thing that changed was how honestly we looked at where the time was going — and how willing we were to fix small, unglamorous things first.

Start by measuring, not guessing

Our first instinct was to blame the usual suspects: the test suite, the bundler, the Docker layer cache. We were wrong on all three counts. A week of instrumentation showed that nearly forty percent of every build was spent reinstalling dependencies that had not changed, and another quarter went to compiling assets that never reached production. None of this was visible until we timed every step and wrote the numbers down.

The biggest performance win of our year came from a spreadsheet, not a migration. We stopped arguing about what was slow, because we could finally see it.

Once the picture was clear, the fixes were almost boring. We keyed the dependency cache to the lockfile instead of the branch, split the asset pipeline so the marketing pages built only when they changed, and moved the slowest test shard to the front of the graph so it stopped straggling at the end. No single change saved more than four minutes. Together they saved thirteen.

The lesson we keep returning to is that slow builds are rarely a tooling problem — they are a visibility problem. Measure first, argue second, and reach for the new stack only when the numbers insist. Ours, it turned out, was fine all along.