Research · CI profiling
Where CI time goes: a profile of 32 replayed runs
The question
GPUs exist because graphics spends most of its time in a few small operations. We wanted to know whether CI has an equivalent: one kernel, such as hashing, compression or moving data, that takes enough of a pipeline's time to be worth special hardware. We also wanted to know where the time goes in general, which nobody seems to have published across repositories. Our plan set a bar: a kernel would have to take at least 25% of CPU time across most repositories.
Method
Each replay checks out one recent commit, installs dependencies, and runs the repository's own test command in a fresh container with 2 vCPU and 8 GiB of memory. Eight commits per repository, 32 in all. A sampler inside the container reads the container's CPU, disk, network and pressure counters every 2 seconds and records how much CPU each process used, grouped by program. Short-lived processes are credited to their parent when they exit, and whole-replay attribution came out at 100.0–100.2% of the CPU the container used.
Busy below means CPU used divided by the CPU available (wall time × 2 vCPU). DiffCI's own step in these replays is left out of every figure. Its results for these repositories are still being fixed and are not reported here.
Results by repository (medians of 8 replays)
| Repository | Setup (clone + install) | Test stage | Test stage busy | Where the test stage's CPU went |
|---|---|---|---|---|
| A: large monorepo, Node test runner | 32 s | 30.9 min | 58% | Test processes about 95%, tsc 2–3% |
| B: docs platform, Bun | 37 s | 36 s | 86% | Bundling packages before the tests 60%, Bun's test runner 13% |
| C: CLI tool, Vitest | 16 s | 39 s | 57% | Vitest workers 80–90% |
| D: API tooling monorepo | 29 s | none* | – | Package manager 23% of the whole replay's CPU |
* Repository D's test command exited at once in our container, so it adds setup data only.
Fixed kernels were tiny
| Kernel | Largest share of one replay's CPU |
|---|---|
| git | 3.8% |
| Compression (gzip, zstd and similar) | 2.2% |
Archiving (tar) | 1.7% |
| Hashing tools | never seen |
No kernel came within a tenth of the 25% bar. By Amdahl's law, a chip that made all four free would save at most a few percent of these runs. The CPU went to whole programs: test runners, a bundler, the TypeScript compiler and package managers. Those are general-purpose code, which only a general-purpose CPU runs well.
What this suggests
- The runner was idle much of the time. In the 30-minute test stage, 2 vCPU were only 58% busy,
so about 42% of the paid CPU did nothing. Updated 2026-12-04: a follow-up run found the cause. The test
runner, Vitest, starts one worker fewer than the CPUs it sees, so on 2 vCPU it ran one test worker. On a quarter
of the same suite, setting
--maxWorkersto the CPU count cut the wall time by 43% on 2 vCPU (494 s to 281 s, 98% busy) and by 13% on 4 vCPU (175 s to 152 s), with the same tests passing and about the same total CPU. So the idle time was a worker-count default, not disk or network, and the gain shrinks as cores grow. - Tests can hide build work. In repository B, 60% of the test stage's CPU built packages before any test ran. Caching that build, or skipping it when nothing it builds has changed, would save more than any faster test runner.
- Setup is a large share of short pipelines. Clone and install took about half of B's replay and a quarter of C's. A nearby dependency cache helps these repositories more than anything in the test stage.
- The biggest saving is work that doesn't run. None of the above beats not running tests a change can't affect. That is what DiffCI does, but this page doesn't measure it.
What this shows and what it doesn't
It shows that in these 32 runs no single fixed kernel was a meaningful share of CI CPU, and that test stages left a lot of the machine idle, mostly because of the test runner's default worker count.
It doesn't show a general rule. Limits:
- Four repositories, all TypeScript. Our plan asks for at least ten in several languages before calling the question closed. Large C++ or Rust builds, or pipelines that build container images, may look different.
- Our container, not their CI. Their runners have different CPUs, caches and parallelism, so wall times will differ.
- Process-level only. Hashing or compression done inside Node, Bun or the compiler is counted as
that program, not as a kernel. Finding those needs a CPU profiler such as
perf, which we haven't run yet. - One repository had no test stage. Repository D only contributes setup data.
The sampler (profile.sh), the summariser (replay_profile.py) and the per-replay summaries
are kept in DiffCI's research repository, together with the findings log, and are available on request. We'll update
this page as profiles from other languages come in.