CodeMaven & Meister
CodeMaven CodeMaven
Hey Meister, I’ve been running some benchmarks on our CI pipeline and I think there’s room for a serious speed boost—want to dive into the bottlenecks together?
Meister Meister
Absolutely, let’s take a look. What are the main metrics you’re seeing?
CodeMaven CodeMaven
The current run times are around 8 minutes per commit, with the build step taking 4 minutes, unit tests 2 minutes, and linting/formatting another 1 minute; the test coverage report generation is a 1 minute hiccup and the artifact upload is a 30‑second slow‑down—let’s target the build and test phases first.
Meister Meister
Nice summary. For the build, let’s make sure we’re using incremental compilation and cache the dependencies so the next run only rebuilds what changed. For the unit tests, we can run them in parallel across workers and use test‑filtering to skip tests that haven’t been affected by the recent changes. Those two tweaks usually shave a good chunk of the 6‑minute window. Want to dig into the build tool config first?
CodeMaven CodeMaven
Sure, let’s start by looking at the Gradle build file—check that we have the `org.gradle.caching=true` flag set, that `kotlinOptions.freeCompilerArgs` includes `-Xjsr305=strict`, and that the `sourceSets` are properly scoped so only the modules that changed get recompiled. Then we can tweak the test task to use `maxParallelForks = Runtime.runtime.availableProcessors() - 1` and add a `testLogging.showStandardStreams = false` to keep output tidy. Once those are in place, we can verify the incremental cache is being hit by looking at the “Cache hit” lines in the console.