Repository navigation
perf(check): cap native typecheck scheduler width - #2288
Conversation
Co-authored-by: sisyphus-dev-ai <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Configure and verify scheduler width scripts/typecheck.ts, scripts/typecheck.test.ts, changelog.d/typecheck-gc.md |
The wrapper sets a default GOMAXPROCS of min(32, availableParallelism()) and preserves a caller-provided value. Tests cover defaults, overrides, combined settings, and empty-string values for both compiler processes. The maintenance note documents the scheduler limit and preserved caller settings. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related PRs
- devswha/ovis#2276: Introduced the typecheck wrapper and caller-overridable
GOGCandGOMEMLIMITsettings that this change extends.
Merge Risk: 
Minimal · up to df345
-
No merge-blocking issue is identified; the scheduler cap and environment-variable behavior are covered by the reported tests.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Merging df34509, the follow-up to #2276. Codex was at capacity, so the merge pass read the diff and an omo reviewer on gpt-6.1-sol reviewed it; both pass with no findings. scripts/typecheck.ts now also sets GOMAXPROCS=min(32, cores) for the native tsc unless the caller set GOMAXPROCS (an empty value is kept); GOGC=400 and GOMEMLIMIT handling are unchanged. The lane measured it with #2276's alternating-pair method against GOGC=400 alone: about 11% less CPU, 11% less wall time and 14% less RSS. Verified: scripts/typecheck.test.ts 8/8 on this 128-core host (cap 32) and under taskset with 1 and 2 cores; |
Change
Follow-up to #2276. Native TypeScript 7 is a Go binary; cap its default scheduler width at
min(32, availableParallelism())alongside #2276'sGOGC=400default.GOMAXPROCSonly when the caller did not set it.GOMAXPROCS.GOGCstill wins under the same rule, andGOMEMLIMITremains untouched.inherited stdio, and failure exit codes.
Final-tree measurement
Measured on #2276 head
00df2254735dbebb2185e38ee323c6a55eeb6835, before thisfollow-up. Five rotated rounds ran B/P/N, P/N/B, N/B/P, B/P/N, P/N/B inside one
dori heavy ram-gogc-pradmission.GOGC,GOMAXPROCS, andGOMEMLIMITunset.GOGC=400,GOMAXPROCSunset.GOGC=400,GOMAXPROCS=32.N versus B: CPU -32.02%, wall -3.12%, full RSS +2.26%, main RSS
-0.25%, tools RSS +8.30%.
N versus P: CPU -11.13%, wall -11.01%, full RSS -14.30%, main RSS
-13.58%, tools RSS -3.98%.
Every N CPU run was below P's 67.21-second median: 66.90, 50.26, 57.61,
59.73, 67.18. N also beat P on median CPU and median wall, satisfying all
predeclared gates. The closest N run was 67.18 seconds versus P's 67.21-second
median, a 0.03-second margin. No run was discarded.
This was a noisy shared host: the recorded one-minute load average ranged from
95.66 to 141.61 at the start of the measured commands (approximately
95-140). Rotation and the per-run table retain that noise rather than hiding it.
Every run
Concurrency sizing
Median direct main-compiler RSS is 1190.29 MiB with N versus 1193.28 MiB with B.
At 24 simultaneous main compilers:
The median main-compiler RSS is effectively unchanged (-0.25%), while CPU falls
32.02% versus B and 11.13% versus P.
GOMAXPROCSlimits scheduler parallelism,not memory, and caller
GOGC,GOMAXPROCS, andGOMEMLIMITremain available.Validation
On this head (
df345097, rebased onto main after #2276 merged as4b07d0cc):bun test ./scripts/typecheck.test.ts(inside check fast): 8 pass, 0 fail.bun run check fastthroughdori heavy ram-gogc-pr: exit 0; workflow syntax,generated types and themes, typecheck, build, and unit tests all ok;
8326 pass, 0 fail, 34 skip in 533 files.