DiffCI
← All case studies

Research · CI profiling

Where CI time goes: a profile of 32 replayed runs

These are replays on DiffCI's own machine, not measurements of anyone's CI. The four repositories are public open-source TypeScript projects. They are not DiffCI customers and haven't seen or endorsed this page, so they are described here but not named, following the rule on the case-studies page: replays of other projects are named only after their maintainers have seen them.
32full CI runs replayed and profiled
≤3.8%of CPU for any fixed kernel (compression, archives, git, hashing)
~42%of the CPU idle during the 30-minute test stage
60%of one test stage's CPU spent bundling, not testing

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)

RepositorySetup (clone + install)Test stageTest stage busyWhere the test stage's CPU went
A: large monorepo, Node test runner32 s30.9 min58%Test processes about 95%, tsc 2–3%
B: docs platform, Bun37 s36 s86%Bundling packages before the tests 60%, Bun's test runner 13%
C: CLI tool, Vitest16 s39 s57%Vitest workers 80–90%
D: API tooling monorepo29 snone*–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

KernelLargest share of one replay's CPU
git3.8%
Compression (gzip, zstd and similar)2.2%
Archiving (tar)1.7%
Hashing toolsnever 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

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:

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.