perf(linux): full make -j per parallel config (no //nconfigs split)
Splitting make -j across configs (jobs // nconfigs) made each parallel config single-threaded on a 4-vCPU VM, so 3 concurrent serial builds were as slow as the old sequential path (~7min). Windows (MSBuild) runs the 3 configs in parallel each using all cores and finishes in ~2min on the same vCPU/RAM. Mirror that: give every parallel config the full make -j; the scheduler absorbs the mild oversubscription. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -350,9 +350,14 @@ def main() -> int:
|
||||
wanted = list(CONFIGS.keys()) if "all" in args.configs else args.configs
|
||||
|
||||
if args.parallel and len(wanted) > 1:
|
||||
# Split make jobs across configs so 3 concurrent makes don't
|
||||
# oversubscribe the CPU (mirrors the Windows parallel build).
|
||||
per_jobs = max(1, jobs // len(wanted))
|
||||
# Each config gets the FULL make -j (no //nconfigs split). The
|
||||
# configs are independent; mild CPU oversubscription is handled
|
||||
# by the scheduler and is still far faster than serial — this is
|
||||
# exactly what the Windows (MSBuild) parallel build does, which
|
||||
# finishes in ~2min on the same vCPU/RAM. Splitting -j across
|
||||
# configs neutered intra-config parallelism (on a 4-vCPU VM it
|
||||
# became make -j1) and gave no speedup.
|
||||
per_jobs = jobs
|
||||
print(
|
||||
f"[linux] Building {len(wanted)} configs in parallel "
|
||||
f"(make -j{per_jobs} each)"
|
||||
|
||||
Reference in New Issue
Block a user