How We Designed Our Continuous Integration System to Be More Than 50% Faster
Article Summary
Pinterest's Engineering Productivity team slashed CI build times by over 50% in one week. Here's the architecture that made it possible.
Pinterest's team rebuilt their Continuous Integration system for Optimus, a monorepo with 120+ Java services serving 300 monthly contributors. They moved from running all targets to intelligently selecting only what changed, using Bazel queries and custom tooling.
Key Takeaways
- P50 build times dropped from 52 to 19 minutes (2.7x faster)
- Custom build-collector CLI uses Bazel queries to find minimal target sets
- Custom release rules abstract infrastructure and enable parallel artifact generation
- Language-based monorepos reduce pipeline management overhead
- Dispatcher model parallelizes test and release targets across workers
Critical Insight
By running only changed code with Bazel queries and parallelizing releases, Pinterest cut CI times from 52 to 19 minutes at P50 and 69 to 49 minutes at P90.