What’s worse than a slow CI run? A slow run that keeps repeating work it never needed to do. Alexis cut a Scala project’s pull-request builds from about 27 minutes to roughly 4 without dropping tests, replacing real Postgres or app integration tests with mocks, or adding infrastructure. The improvements came from measuring each suspected bottleneck on actual CI rather than guessing.
The biggest gains came from sharing one Postgres container across the test suite, reusing a warm sbt server, and fixing ineffective caches. Smaller wins came from running tests in parallel on the four-core CI runner, limiting checks to changed paths, and reducing redundant setup. The post lays out the measured changes and their trade-offs, including why a remote build cache or splitting jobs wasn’t worthwhile yet. Its central lesson is refreshingly practical: inspect the slow steps, test one fix at a time, and optimize for the machine that actually runs your builds.
continue reading onalexitc.com
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.