CI Pipeline Speed: Cutting Build Times That Cripple Velocity
Slow CI is engineering tax compounded daily. The fixes are mechanical; the discipline is rare.
The four CI bottlenecks
1. Test bottleneck. Sequential test runs that should be parallel.
2. Build bottleneck. No incremental builds.
3. Dependency bottleneck. Pulling deps fresh each run.
4. Resource bottleneck. Underprovisioned runners.
Parallelisation patterns
- Test parallelisation: split test suite by file, by class, by historical timing. Tools (CircleCI test splitting, GitHub matrix) make this one-line.
- Job parallelisation: run lint + test + security scan + build concurrently, not sequentially.
Caching strategy
Cache dependencies between runs. npm/yarn/pip/cargo all support this; CI providers cache transparently.
Cache build outputs (Bazel, Nx, Turborepo) for monorepos.
Cache Docker layers (BuildKit) on container builds.
Per-pipeline budget
Per-pipeline time budget: 5 minutes for fast feedback; 15 for full validation. Anything past budget gets investigated.
PRs that add >30s to the pipeline require justification.
Antipatterns
- One serial pipeline. No parallelism = no speed.
- No caching. Every run starts from zero.
- Slow tests ‘temporarily skipped.’ Permanent within a quarter.
What to do this week
Three moves. (1) Apply this to one pipeline first. (2) Measure deploy frequency / MTTR before/after. (3) Document the outcome so the next team starts from data.