Skip to content

perf(build): size -b --fast builders and checkers to the machine - #1228

Merged
maschwenk merged 1 commit into
oxc-project:mainfrom
maschwenk:max/build-fast-builder-budget
Dec 2, 2026
Merged

maschwenk merged 1 commit into
oxc-project:mainfrom
maschwenk:max/build-fast-builder-budget

Conversation

@maschwenk

@maschwenk maschwenk commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

tsrs -b ran 4 builders and 4 checkers per project on any machine. on #1223's 62-project vue monorepo, each small project's 4 checkers rebuild the same shared types (40% more instructions than 1 checker) and 4 builders can't fill 32 cores. a 1,500-file project that the rest waits for also gets only 4 checkers. with --fast, builders come from the cores (the core count up to 8 or a quarter of the cores, whichever is greater, 4 to 16). each project gets one checker per 32 checked files, at least one per 8 cores (1 to 4) and at most what --fast gives a program checked alone. a builder starts compiling a project only when the checkers estimated for the projects in flight stay within 2 per core, so fewer big projects build at once. counts depend only on the machine and the project, never on scheduling. without --fast nothing changes. -b keeps go's 4 x 4, and diagnostics, emitted files, build info and counters are byte-identical to main. --builders, --checkers and --singleThreaded still override the defaults. giving either count turns the machine sizing off, so the other stays at 4

the cost is memory at 16-32 cores, mostly because a big project gets the checkers --fast gives a lone program (lobehub +72% at 32 cores). graphs of many 250-file projects run 3-4% slower on 4-8 cores for 27-36% less memory. tests cover the rule's table, the builder count in each mode and with --checkers alone, a non-fast build reporting exactly the --checkers 4 counters, and --fast --builders keeping 4 checkers per project. per-project times in --extendedDiagnostics, the issue's second ask, are left for a follow-up. numbers are cold -b --force --fast, main vs this branch, on an m8g.8xlarge with fewer cores emulated by cpu affinity. fixtures are on a ram disk, medians of 5 (catalog projects 3). sweeps, solution generation and an x86 run are in notes/perf-build-fast-defaults.md

workload cores wall cpu peak rss instructions
#1223 vue monorepo, 62 projects 4 3,453 β†’ 2,860 ms (-17%) -27% -39% -29%
8 1,987 β†’ 1,859 ms (-6%) -27% -8% -29%
16 1,437 β†’ 1,323 ms (-8%) -13% +17% -18%
32 1,373 β†’ 1,036 ms (-25%) 0% +42% -1%
a 1,500-file project + 40 small ones (3 layouts) 8 -13% to -35% -10% to -16% -6% to +8% -8% to -12%
32 -56% to -60% -1% to -2% +11% to +34% 0%
24 projects of 250 files 4 / 8 +3% / +4% -2% / +4% -36% / -27% 0% / +3%
16 / 32 -12% / -34% +8% / +5% +3% / +50% +3% / +2%
vscode, -b src --noEmit 8 / 32 -37% / -55% +4% / +10% +6% / +12% +5% / +8%
sentry, 3 references 8 / 32 -24% / -48% +12% / +29% +12% / +33% +16% / +35%
lobehub, 1 reference 8 / 32 -25% / -40% +35% / +71% +32% / +72% +42% / +81%

Fixes #1223

@maschwenk
maschwenk force-pushed the max/build-fast-builder-budget branch from 2aad3d8 to 6c61156 Compare December 2, 2026 15:29
@maschwenk maschwenk changed the title perf(build): size -b --fast builders and checkers to the machine (Vue monorepo -25%, vscode -55% at 32 cores) perf(build): size -b --fast builders and checkers to the machine Dec 2, 2026
`tsrs -b` ran 4 builders and gave every project 4 checkers on any machine. With `--fast`, the builder count now
comes from the cores (the core count up to 8 or a quarter of the cores, whichever is greater, 4 to 16), and each project gets one checker
per 32 checked files, at least one per 8 cores (1-4) and at most what `--fast` gives a program checked alone. A builder starts
compiling a project only when the checkers estimated for the projects being compiled stay within 2 per core, so a graph of
large projects builds fewer of them at once. A project's checker count depends only on the machine and the project,
never on scheduling. Without `--fast`, `-b` keeps Go's 4 builders and 4 checkers per project. `--builders`,
`--checkers` and `--singleThreaded` still override the defaults, and giving either count turns the machine sizing
off, so the other stays at 4.

Measured with cold `-b --force` on a 32-core Graviton box, with 4-16 cores emulated by CPU affinity
(notes/perf-build-fast-defaults.md): the issue's 62-project Vue monorepo took 17%, 6%, 8% and 25% less wall time
at 4, 8, 16 and 32 cores, and a 1,500-file project among 40 small ones 33-60% less at 8-32 cores. Peak memory
ranges from -39% at 4 cores to +72% for a large single project at 32 cores.

Fixes oxc-project#1223
@maschwenk
maschwenk force-pushed the max/build-fast-builder-budget branch from 6c61156 to 7e05e1e Compare December 2, 2026 15:39
@maschwenk
maschwenk marked this pull request as ready for review December 2, 2026 15:39
@maschwenk
maschwenk enabled auto-merge December 2, 2026 15:40
@maschwenk
maschwenk added this pull request to the merge queue Dec 2, 2026
@codspeed

codspeed Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

Warning

oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.

1 warning

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

βœ… 8 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing maschwenk:max/build-fast-builder-budget (7e05e1e) with main (48b14f3)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Merged via the queue into oxc-project:main with commit 5ba5579 Dec 2, 2026
76 of 84 checks passed
@maschwenk
maschwenk deleted the max/build-fast-builder-budget branch December 2, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

-b uses 4 builders on any machine, and each program's 4 checkers rebuild the same types

1 participant