perf(ci): investigate 20-minute Linux unit job, cold_skip misses, and example runtime
Problem
The Linux unit-test job for PR #4511 passed 310/310 tests but took 20m12s in https://github.com/FastLED/FastLED/actions/runs/35809747697/job/107018475769?pr=4511 (commit acfc3eed59f986e5db00e62d5490c44b3cedfd15). Runner timing: Meson setup 3.92s, compilation 1130.84s (core/PCH 196.25s, objects 422.62s, test linking 326.91s), test execution 75.64s. Examples were not requested.
Zccache reported 345 requests, 0 hits / 345 misses, and 100% cold_skip despite a populated depgraph on disk; its warning refers to #320 / #796 SI-2. A fresh hosted runner may legitimately have no reusable objects, so this warning alone does not prove zccache caused the delay.
.github/workflows/template_unit_test.yml runs ./test --clang --no-parallel --unit --verbose --debug --log-failures failures. This combines serialized compilation with full debug mode. The example-test template also uses --no-parallel --examples --verbose --debug; investigate its timing separately, including whether example execution loops repeat unnecessarily.
Investigation / fix
- Capture phase timings, runner CPU/memory pressure, compiler/build flags, Ninja job count, link commands, and zccache miss reasons. Compare clean and warm runs of the same revision. Determine whether cold_skip is expected first-build behavior, absent persisted cache, or a classifier defect; link/file the zccache-owner issue if needed.
- Benchmark safe variants: bounded parallelism, quick versus debug/sanitizer mode, PCH/link strategy, and cache persistence. Explain the 326.91s linking segment. Preserve intended coverage and diagnostics.
- Separately measure example-workflow compilation and runtime, identify repeated example iterations/loops, and reduce redundant iterations where coverage remains intact.
- Implement measured improvements and add a visible performance regression signal.
Acceptance criteria (RED → GREEN)
- RED: Document this 20m12s baseline (1130.84s compilation, 75.64s execution, 0/345 hits, 100% cold_skip) and comparable clean/warm baselines for unit and example workflows.
- GREEN: A follow-up PR identifies dominant causes and measurably improves unit-job wall time on comparable hosted runners, with before/after phase timings. If zero hits is expected on fresh runners, correct the misleading warning; otherwise fix/link the cache problem and demonstrate warm hits.
- GREEN: Measure example iteration counts and reduce redundant work safely; report example before/after runtime separately.
- GREEN: All 310 unit tests and intended example coverage still pass. Document any debug/sanitizer or parallelism tradeoff.
Decisions
- Track in FastLED because its CI workflow and runner configuration are actionable here; split/link a zccache defect only after confirming behavior.
- Example timing is related but not the cause of this unit-only job.
- Do not call zero hits a regression without a warm-cache comparison.
Source: FastLED/FastLED