Every engineering team has felt it: the slow creep of build times that turns a quick coffee-break deploy into a frustrating wait. Six months ago, our CI pipeline had ballooned to just over eleven minutes per push. Today it runs in under five — and we didn't swap out a single tool. Here's how we did it.
The first instinct when builds get slow is to reach for a new bundler, a faster test runner, or a shinier CI provider. But after a few rounds of "let's just try switching to X" that fizzled out, we decided to step back and treat the problem like any other performance investigation. That meant instrumenting first, opining later.
Start by measuring, not guessing
We added lightweight timing markers to every phase of the pipeline: dependency installation, linting, type-checking, unit tests, integration tests, and the actual bundling step. Within a week we had a clear waterfall chart that told an uncomfortable story. Over sixty percent of the total time was spent in two places: type-checking and a handful of integration tests that were waiting on external service mocks to spin up.
The type-checker was running across the entire monorepo on every commit, even when only a single package had changed. The integration tests were spinning up fresh Docker containers for each run, many of which were redundant across test suites. Neither problem required a new stack — just a sharper approach to how we used the one we already had.
"The most expensive millisecond in any pipeline is the one you never measured. Once you see the waterfall, the fix is rarely the hard part."
We introduced a simple dependency graph for type-checking so that only affected packages and their dependents get checked on a given change. For the integration tests, we consolidated container lifecycle management so that shared services start once and stay warm across suites. Together, those two changes cut our average pipeline duration from eleven minutes to just over five.
There's a temptation in this industry to chase the new — the faster bundler, the leaner runtime, the tool everyone is talking about on Hacker News. And sometimes those really do pay off. But more often than not, the biggest gains are hiding in plain sight, buried in the assumptions we stopped questioning. Measure first. Then act. The stack you already have might be more than enough.