Commit e0b99da6
e0b99da624c0Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 2 files · ~2 modified
Description
Speed up the windows-mingw test step
The Windows "Run tests" step dominated CI at ~16min (vs ~2-3min for the whole ubuntu/macos jobs) because each of the 846 per-test builds spawns ~10 processes and links once, and Windows multiplies all of that: Defender real-time scanning, MSYS2 process-creation cost, and an sccache wrapper that always misses on the unique per-test generated C.
Four changes, all reversible:
- Disable Defender real-time monitoring on the runner (compile-heavy CI's classic multiplier; CI-only, no correctness impact).
- Oversubscribe -j to 2x nproc for the test step (spawn/link-latency bound, not CPU bound).
- Run the test compile with plain gcc (CC=gcc); sccache only adds miss-overhead on unique test C. The build step keeps sccache, where caching the runtime/prism objects pays off.
- Merge the per-test compile+link into a single cc invocation (Makefile, all platforms): removes ~846 process spawns and the .o temp; sccache never cached the unique test C, so nothing is lost.
Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
Details
- Commit
- e0b99da624c0
- Parent
- 54923cf2197d
.github/workflows/ci.ymlmodifiedView file
@@ -97,6 +97,16 @@
9797
CC: sccache gcc9898
SCCACHE_GHA_ENABLED: "true"9999
steps:100+
# Real-time scanning of every spawned cc/ld/.exe and temp file dominates101+
# this compile-heavy job (846 per-test builds). Turning it off cuts the102+
# test step several-fold. try/catch so a Defender policy change can never103+
# red the job.104+
- name: Disable Defender real-time monitoring105+
shell: pwsh106+
run: |107+
try { Set-MpPreference -DisableRealtimeMonitoring $true }108+
catch { Write-Host "Could not disable Defender realtime monitoring: $_" }109+
100110
- uses: actions/checkout@v6101111
102112
- name: Set up MSYS2 (MINGW64)@@ -139,7 +149,12 @@
139149
run: make -j$(nproc) LTO=0 all140150
141151
- name: Run tests142-
run: make -j$(nproc) test OPT=-O0152+
# Oversubscribe -j (process-spawn/link-latency bound on Windows, not153+
# CPU bound) and use plain gcc: each test's generated C is unique, so154+
# the sccache wrapper only adds miss-overhead per compile here (the155+
# build step above keeps sccache, where caching the runtime/prism156+
# objects pays off).157+
run: make -j$(( $(nproc) * 2 )) test OPT=-O0 CC=gcc143158
144159
- name: sccache stats145160
if: always()MakefilemodifiedView file
Loading diff…