Repository navigation
Ignore skipped default library weight in checker partitioning - #65746
Jake Bailey (jakebailey) wants to merge 1 commit into
Conversation
Default library files skipped via skipLibCheck or skipDefaultLibCheck incur no direct per-file checking work and have no module imports, yet their AST node count and text length still contributed to checker partition weights. Because lib.dom.d.ts is large, routine DOM type and comment updates shifted application file assignments across checkers, causing unrelated performance swings in benchmarks such as Effect, MUI, and XState. Excluding skipped default libraries from partition weights keeps source file assignments stable across default library updates while preserving the calibrated declaration-locality policy for non-default declaration files.
|
TypeScript Bot (@typescript-bot) test it |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the checker-partitioning change.
No open issues 🎉
What changed in this PR
This PR adjusts the compiler’s checker partitioning to ignore the size of skipped default libraries, aiming to mitigate performance costs from DOM type growth such as #65487.
Changes:
- Gives skipped default libraries zero partition weight while preserving declaration-file classification.
- Handles zero total weight without dividing by zero.
- Adds tests for all-zero weights and stable source-file assignments when skipped library size changes.
| File | Description |
|---|---|
tsc/internal/compiler/checkerpool.go |
Excludes skipped default-library weight and guards the zero-weight calculation. |
tsc/internal/compiler/checkerpool_test.go |
Tests zero-weight handling and assignment stability across library sizes. |
Review effort: Balanced
|
Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready. Everything looks the same! |
|
Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing Everything looks good! |
|
Jake Bailey (@jakebailey) Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Jake Bailey (@jakebailey) Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
This is an attempt to mitigate the perf cost of #65487; basically, give zero weight to
lib.d.tsfiles when we aren't checking them.I don't generally like having affinity depend on a flag such that flipping it matters, but I think this is actually fine because whether or not one checks a file affects the kind of ordering issues we already have.
Local check-time medians (percentages relative to
main):4 checkers
mainmain + #65487this PRthis PR + #654872 checkers
mainthis PR8 checkers
mainthis PR