Measuring Real Job Time Gains When Combining Warm Caches and Parallel Tests in GitHub Actions
Caching and parallelism don't add up, so measure each stage.
Sponsored by Graphide

To speed up slow GitHub Actions CI, measure the workflow before changing it, then add dependency caching and parallel jobs separately. Warm caches shorten individual jobs, while parallelism shortens the wait for independent jobs to finish. Their combined gain depends on the critical path, so wall-clock time, queue time, billed minutes, and cache hit rate must be compared at each stage.
Why wall-clock time and billed minutes diverge when you parallelize GitHub Actions jobs

A dependency cache removes repeated network work from an install, shrinking the duration of the job itself. Jobs that are independent run at the same time. Consequently, the elapsed time for that group is governed by its slowest job, while its compute usage still includes every job.
Wall-clock time is how long a developer waits, while billed minutes measure the compute used across jobs. GitHub rounds billed job-minutes up, so running work at the same time does not always make the bill smaller. Caching can reduce both clocks by shortening execution. Parallelism can improve feedback time without reducing compute usage, which makes a single before-and-after duration an incomplete result.
Why coding agents make this measurement problem more urgent
Coding agents increase the number of commits and pull requests that trigger CI, exposing inefficiencies that were less visible when developers ran pipelines only a few times a day. An unoptimized 15-minute pipeline can become a constant queue when an agent pushes many small commits. Each push adds another demand for a verdict. That verdict also guides the agent’s next action, so slow CI delays more than human review. In 2026, this makes concurrency controls, caching, and measured feedback time a team-level infrastructure concern.
The four numbers a team must track before touching any configuration
The baseline needs four measurements, starting with workflow wall-clock time from the first job created to the last job completed. Queue time is how long each job waits for a runner before it starts. The two must remain distinct throughout the comparison. A shorter execution can disappear inside a longer queue, particularly when a workflow reaches its concurrency limit. The GitHub Actions timing breakdown provides the timing context needed to separate waiting from execution.
Per-job billed minutes expose the compute trade-off that workflow duration hides. Because billing rounds each job up, splitting work can change the total even when the underlying test workload stays the same. Record the billed minutes for each job as well as the total. Per-step durations then explain whether a change came from dependency installation, test execution, or another part of the critical-path job. These timings supplement the four metrics.
Cache hit rate is the fraction of runs with an exact primary-key match. A successful cache step is not sufficient evidence. The cache-hit output from actions/cache returns true only for an exact match, while a partial restore-keys match and a genuine miss can both leave a green step. Logging that output explicitly distinguishes an effective cache from one that merely completes without error. Without it, a misconfigured monorepo can appear healthy while repeatedly missing its intended cache.
How the dependency cache actually works, and why the key design determines whether it works at all
Dependency caching preserves reusable state between workflow executions when jobs start on fresh runners. For the cache to work, dependencies that have not changed must produce a matching key. The key is the cache’s reuse boundary. A lockfile hash ties that boundary to dependency changes. When dependencies remain unchanged, a warm hit avoids repeated network work and can turn a minutes-long install into seconds.
With the setup actions, actions/setup-node@v4 accepts the cache value 'npm' and uses the lockfile hash automatically, while actions/setup-python@v5 accepts 'pip'. Go has a specific version distinction worth preserving. actions/setup-go@v7 enables caching by default, and since v6.3.0 its key hashes go.mod following a switch from go.sum. These settings take less work to set up, but the hit rate still shows whether the cache is being reused.
A restore-keys fallback can restore a prior cache when the primary key misses, allowing installation to run on top of it. That is useful without being an exact hit. By contrast, a volatile environment variable in the key can invalidate reuse on otherwise unchanged runs. A broadly scoped monorepo key can likewise make one package’s dependency change invalidate caches for other packages. Consistently false cache-hit output when dependencies have not changed is the signal to inspect key design, cache paths, and scope.
How parallelizing jobs changes what wall-clock time measures
For sequential jobs, execution time is the sum of their durations. For independent jobs running concurrently, it becomes the maximum duration, subject to queueing and any later dependent work. Lint, typecheck, and test can typically run independently. Deployment remains gated on all three passing through its needs configuration, so parallel execution does not require weakening the release condition. The workflow’s dependency structure determines which durations overlap and which still accumulate.
After that restructuring, the slowest parallel job determines when the next stage can begin. It becomes the critical-path job for that group. Shortening a job that already finishes earlier will not move that boundary, even if it reduces billed minutes. Further wall-time gains require shortening the critical-path job or splitting its work. Comparing when jobs end shows which job holds up the next stage before another change makes the configuration more complex.
Splitting tests has another limit because each shard has overhead. Every shard pays for checkout, dependency installation, and any browser or tool download before executing tests. As test time approaches that overhead, further splitting offers diminishing gains. If the shard count also exceeds the available concurrency, jobs wait in a queue instead of running at the same time, and wall time may stay just as long.
Why the combined effect of cache and parallelism cannot be measured by summing their individual gains
Caching changes job durations, while parallelism changes how those durations contribute to elapsed time. Their effects therefore interact at the critical path. In a sequential workflow, shorter installs reduce the sum of job durations. In a parallel workflow, shorter installs reduce overlapping durations, and the latest completion determines the result. An install saving on an early-finishing job may reduce billed minutes without changing workflow wall time at all.
To make the distinction concrete, suppose caching saves four minutes per install and parallelism collapses three sequential jobs into one maximum. The combined saving from the isolated four minutes and eight minutes depends on the final topology. The result depends on each job’s duration after caching and on which job finishes last after parallelization. This is why an improvement measured against the original workflow cannot simply be added to another improvement measured against that same workflow.
Warm caches also cut the time spent on setup during parallel execution because each parallel job runs its own install. When the relevant cache is already warm, those repeated installs can fall from minutes to seconds. The smaller overhead still includes checkout, cache operations, and tool setup on each shard, and queueing can still keep shards from running at the same time. Step timings are needed to distinguish reduced install overhead from reduced test execution time.
The interpretable sequence is a baseline, caching on the existing topology, and then parallelism with caching active. Each comparison shows what changed from the state just before it. Applying both changes together and recording only final wall time loses that attribution. It also leaves the new bottleneck unexplained. A team that records install duration and critical-path timing can reason about its next change instead of assuming that another isolated speedup will translate directly into less waiting.

Running the measurement in practice — a before-and-after protocol
First, run the existing workflow on several recent commits without changing its execution configuration. Record wall-clock time, queue time per job, billed minutes per job, and cache hit rate where caching is present. Keep the baseline’s cache state explicit throughout. A cold sequential baseline and an already warm workflow are different starting conditions. Expand each job in the Actions UI to retain the step timings that will explain later changes.
Next, apply dependency caching without changing the sequential job structure. On another run, record the same four metrics, separating exact-hit runs from misses and fallback restores. The expected signal is shorter dependency-install time on hits. Per-job billed minutes should also fall where the duration reduction crosses a billing boundary. A green cache step without shorter installs or a useful exact-hit rate does not establish that this stage succeeded.
Then run lint, typecheck, and test concurrently with caching active, and repeat the measurements. Wall-clock time should move toward the slowest parallel job’s duration, with dependent stages and queue time still accounted for. Billed minutes may rise with duplicated setup and rounding. Compare job end times to find the new critical path, since tests may no longer be the bottleneck. If the test job does determine completion, evaluate sharding one shard at a time and re-measure.
Finally, keep monitoring cache hit rate after configuration changes. A sudden drop can silently reverse an earlier improvement. Log cache-hit as a workflow output, or use a step that fails on an unexpected miss while developing the configuration. The run summary, job timing breakdown, and logged cache output show the key results without the need for external tooling.
What faster runner alternatives help slow GitHub Actions workflows, and what should teams verify?
Runner hardware changes how long each step takes, but problems with dependencies or topology remain. GitHub’s default runner for private repositories is a 2-core machine, while public repositories receive a 4-core machine. Internally parallel tests and compilation can benefit from more cores. Conversely, the 1-core slim Linux SKU, actions_linux_slim, suits short lint or typecheck jobs where a 2-core machine is unnecessary overhead. GitHub cut hosted runner prices on January 1, 2026, so cost comparisons must use the new prices in place of earlier assumptions.
Third-party options include Blacksmith and Depot, with larger machines, warm images, and persistent dependency caches available across the field. A test job that parallelizes internally may benefit from a larger machine on that job alone. A workflow that spends most of its time on cache restore needs a different comparison that checks whether dependencies are already there when execution starts. Persistent local dependencies can make the conventional exact-match hit rate less informative than it is for a restored cache.
Graphide CI is another option, running existing GitHub Actions jobs on warm machines sized to each job, with AI agents retuning jobs as code changes. It preserves the pass-or-fail verdict and runs every test while reducing waiting.
A team evaluating any runner change should retain the same workflow for the comparison. Otherwise, hardware and configuration effects become difficult to separate. A faster result accompanied by a changed cache hit rate or queue time is not purely a hardware result. Persistent-cache behavior also needs to be accounted for when interpreting cache measurements. Before attributing a gain to the runner, repeat the same four metrics, namely wall-clock time, queue time, billed minutes, and cache hit rate.
The common patterns that make measured gains disappear or never appear
Cache regressions often hide behind successful workflow steps. A part of the key that changes often or a monorepo scope that is too broad can stop the cache from being reused while the cache step stays green. Exact-match hit rate exposes that failure directly. Install-step timing then shows whether fallback restores still save time or installation takes as long as it would from cold. Together, those signals distinguish a key problem from a slower test suite.
If noncritical jobs finish sooner but the last job takes just as long, wall-clock time stays the same. Excessive sharding can instead leave critical-path duration flat while billed minutes rise because setup dominates each shard. Concurrency exhaustion adds visible queue time to that pattern. These outcomes identify different limits, so adding more parallel jobs is not a general remedy for a stalled improvement.
Persistent self-hosted runner state introduces a correctness concern beyond timing. Accumulated global packages, leftover port bindings, or stale lockfile-independent state can make tests pass on the runner and fail elsewhere. The four timing metrics cannot establish verdict equivalence. The same-verdict requirement must therefore remain a condition of any claimed improvement. A shorter workflow is useful only when its result remains trustworthy, and its measurements explain where the waiting actually went.


