Skip to content

perf(checker): keep reserved link ids dense past 16M - #975

Merged
maschwenk merged 1 commit into
mainfrom
perf/dense-link-id-cap
Nov 28, 2026
Merged

maschwenk merged 1 commit into
mainfrom
perf/dense-link-id-cap

Conversation

@maschwenk

@maschwenk maschwenk commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

checker link stores stopped indexing reserved ids at Go's 16.7M limit and fell back to hash maps past it. reserved id counters are shared across all checkers in a process, so large programs cross 16.7M even though none of the 19 catalog projects do (vscode tops out at 9.3M). since Rust's reserved ids already stop at 2^31 (the 31-bit AST tag), MAX_PAGE_LINK_COUNT now covers the full 31-bit range and the high-id hash fallback branches are gone. tsrs_core::PagedLinkStore keeps its cap because it takes arbitrary keys and has no production callers.

large private monorepo (--fast, m8g.4xlarge, 15 pairs):

cores wall instructions peak RSS
4 -1.2% -0.5% -2.7%
8 -2.2% -0.5% -3.6%
16 -3.2% -1.1% -5.2%

the 19 CI catalog projects are flat since none crosses 16.7M. tradeoff: each checker's index grows to the highest reserved id it sees (4 bytes per 128 symbol ids or 1,024 node ids, max 64 MiB / 8 MiB at 2^31). adds ids_past_the_old_cap_stay_dense in an isolated child process and notes/perf-dense-link-id-cap.md

@codspeed

codspeed Bot commented Nov 12, 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 perf/dense-link-id-cap (9b394a5) with main (13db502)

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. ↩

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run Β· main 13db50241e4f β†’ PR merge 8af2dd8fdb03 (head 9b394a57f336)

Clef gate: Clef estimated 72.9% default and single-threaded wall time, 73.5% peak RSS, 78.4% single-threaded instruction count impact probability.

Release builds in fast mode (TSRS_FAST=1) with Hyperfine 2 hardware counters. After warming each binary, alternating main/PR pairs measure wall time at both the fast preset's default checker count and with --singleThreaded, with ten pairs per configuration by default. Instructions come from the single-threaded runs; peak RSS comes from the default-count runs.
Incremental runs start with fresh build info before every invocation; check runs disable incremental compilation.

Project Mode Single-thread wall time Ξ” Single-thread instructions Ξ” Default wall time Ξ” Default peak RSS Ξ”
vscode check -0.1% -0.178% -0.7% 0.0%
vscode incremental +0.7% -0.172% +0.1% -0.2%
xstate-main check -0.5% -0.123% -2.7% +0.6%
xstate-main incremental -0.5% -0.120% +1.3% -0.3%
webpack check -0.4% -0.133% -2.5% -0.3%
webpack incremental +0.1% -0.133% +1.2% 0.0%
mui-docs check -0.1% -0.181% +1.4% -0.3%
mui-docs incremental 0.0% -0.177% +0.2% +0.1%
Compiler check +0.4% -0.184% -1.0% -0.6%
Compiler incremental -0.2% -0.182% -0.9% -0.2%
Compiler-Unions check +0.2% -0.176% +1.9% +0.5%
Compiler-Unions incremental +0.9% -0.175% +0.7% 0.0%
cal-diy check +0.7% -0.124% +1.0% +0.1%
cal-diy incremental -0.3% -0.114% -1.2% +0.1%
formbricks-web check +0.1% -0.131% 0.0% 0.0%
formbricks-web incremental -0.4% -0.122% -0.6% +0.2%
supabase-studio check -0.1% -0.150% +0.6% -0.3%
supabase-studio incremental +0.2% -0.131% 0.0% -0.1%
t3code-server check -0.2% -0.293% +1.5% -0.4%
t3code-server incremental -0.7% -0.285% 0.0% -0.1%
mikro-orm check -0.2% -0.130% -0.1% 0.0%
mikro-orm incremental -0.7% -0.130% -0.7% -0.3%
next-packages-next check -0.6% -0.129% -1.1% +0.4%
next-packages-next incremental -0.3% -0.128% -0.4% -0.1%
next-root check -0.2% -0.126% -1.0% +0.6%
next-root incremental -0.1% -0.121% -1.2% +0.3%
storybook check -0.4% -0.111% -0.9% +0.3%
storybook incremental +0.4% -0.111% -2.3% 0.0%
nuxt check -0.1% -0.124% -0.8% -0.4%
nuxt incremental 0.0% -0.128% -2.5% -0.4%
playwright check -0.2% -0.149% +0.1% -0.4%
playwright incremental -0.4% -0.144% -1.5% -0.1%
drizzle-orm check -0.9% -0.156% -3.0% -0.3%
drizzle-orm incremental +0.4% -0.154% -1.8% +0.1%
typeorm check -1.0% -0.155% -1.8% -0.2%
typeorm incremental +0.3% -0.147% +2.6% -0.9%
date-fns check -0.3% -0.099% +0.9% -0.6%
date-fns incremental -0.1% -0.070% +0.8% +0.1%

Negative means the PR used less; positive means it used more. Deltas are medians of paired PR/main ratios for wall time and instructions. Single-threaded runs reduce scheduling noise; shared CI machines can still add noise to wall time.

Measured medians (main β†’ PR)
Project Mode Single-thread wall time (s) Single-thread instructions Default wall time (s) Default peak RSS (MiB)
vscode check 8.505 β†’ 8.462 82,264,688,544.5 β†’ 82,118,095,700.5 1.479 β†’ 1.467 1840.3 β†’ 1840.4
vscode incremental 8.491 β†’ 8.554 84,680,066,597 β†’ 84,533,970,219.5 1.665 β†’ 1.662 2166.3 β†’ 2160.9
xstate-main check 0.509 β†’ 0.508 5,566,864,949 β†’ 5,559,957,270 0.127 β†’ 0.125 241.4 β†’ 242.9
xstate-main incremental 0.543 β†’ 0.539 5,728,612,553.5 β†’ 5,721,759,210.5 0.172 β†’ 0.173 244.7 β†’ 243.9
webpack check 0.920 β†’ 0.918 10,881,835,337 β†’ 10,867,457,714.5 0.201 β†’ 0.197 405.3 β†’ 404.2
webpack incremental 0.955 β†’ 0.955 11,105,382,319.5 β†’ 11,090,405,098 0.247 β†’ 0.250 402.9 β†’ 403.0
mui-docs check 2.371 β†’ 2.372 33,110,144,536.5 β†’ 33,050,335,215 0.939 β†’ 0.951 1237.7 β†’ 1234.4
mui-docs incremental 2.494 β†’ 2.496 34,465,938,561.5 β†’ 34,406,894,329.5 1.094 β†’ 1.094 1160.6 β†’ 1162.2
Compiler check 0.138 β†’ 0.137 1,775,261,168.5 β†’ 1,771,995,493 0.063 β†’ 0.063 77.8 β†’ 77.3
Compiler incremental 0.143 β†’ 0.141 1,789,624,376.5 β†’ 1,786,370,701 0.067 β†’ 0.067 79.2 β†’ 79.1
Compiler-Unions check 0.193 β†’ 0.193 3,052,422,036.5 β†’ 3,047,069,225 0.091 β†’ 0.093 81.1 β†’ 81.5
Compiler-Unions incremental 0.195 β†’ 0.198 3,065,126,981 β†’ 3,059,768,301 0.091 β†’ 0.092 85.2 β†’ 85.2
cal-diy check 2.569 β†’ 2.588 28,972,215,270.5 β†’ 28,935,751,663 0.815 β†’ 0.820 1359.9 β†’ 1361.9
cal-diy incremental 2.690 β†’ 2.683 30,591,334,454.5 β†’ 30,556,614,563.5 1.021 β†’ 1.010 1265.2 β†’ 1267.0
formbricks-web check 3.401 β†’ 3.404 37,093,471,710.5 β†’ 37,045,146,926.5 0.889 β†’ 0.887 1579.8 β†’ 1579.9
formbricks-web incremental 3.528 β†’ 3.518 39,693,208,770 β†’ 39,645,376,029 1.085 β†’ 1.074 1621.3 β†’ 1624.2
supabase-studio check 3.595 β†’ 3.588 40,828,307,247 β†’ 40,766,819,369 0.907 β†’ 0.909 1309.5 β†’ 1305.0
supabase-studio incremental 3.895 β†’ 3.894 43,775,642,720 β†’ 43,718,553,008.5 1.061 β†’ 1.057 1364.7 β†’ 1363.4
t3code-server check 3.544 β†’ 3.531 41,063,358,129 β†’ 40,942,958,758 1.604 β†’ 1.618 1451.9 β†’ 1446.7
t3code-server incremental 3.606 β†’ 3.583 41,578,531,159.5 β†’ 41,463,026,692.5 1.406 β†’ 1.400 1307.0 β†’ 1305.7
mikro-orm check 3.993 β†’ 3.975 44,480,113,075.5 β†’ 44,422,546,197 0.836 β†’ 0.836 1282.0 β†’ 1282.6
mikro-orm incremental 4.111 β†’ 4.083 44,791,446,142 β†’ 44,732,772,727.5 1.105 β†’ 1.094 1259.0 β†’ 1255.6
next-packages-next check 1.458 β†’ 1.451 17,416,879,315 β†’ 17,394,548,139.5 0.371 β†’ 0.367 558.4 β†’ 560.8
next-packages-next incremental 1.482 β†’ 1.481 17,732,653,212.5 β†’ 17,710,150,642 0.433 β†’ 0.433 564.6 β†’ 563.9
next-root check 1.171 β†’ 1.169 13,996,514,429.5 β†’ 13,978,779,940 0.261 β†’ 0.260 428.7 β†’ 431.3
next-root incremental 1.211 β†’ 1.213 14,459,034,944 β†’ 14,441,523,356.5 0.318 β†’ 0.312 473.1 β†’ 474.6
storybook check 0.767 β†’ 0.767 8,867,961,527 β†’ 8,858,055,786 0.203 β†’ 0.199 396.5 β†’ 397.8
storybook incremental 0.808 β†’ 0.808 9,193,139,455 β†’ 9,183,017,122 0.249 β†’ 0.243 374.9 β†’ 374.9
nuxt check 0.820 β†’ 0.817 8,503,087,162 β†’ 8,492,526,189 0.214 β†’ 0.213 390.9 β†’ 389.5
nuxt incremental 0.865 β†’ 0.866 8,906,258,438 β†’ 8,895,447,440.5 0.235 β†’ 0.231 392.3 β†’ 390.8
playwright check 0.665 β†’ 0.668 7,403,531,376.5 β†’ 7,392,516,901 0.175 β†’ 0.176 363.6 β†’ 362.3
playwright incremental 0.691 β†’ 0.688 7,581,858,485.5 β†’ 7,570,907,224.5 0.194 β†’ 0.190 340.9 β†’ 340.6
drizzle-orm check 0.512 β†’ 0.507 5,948,583,947 β†’ 5,939,242,753 0.172 β†’ 0.170 379.7 β†’ 378.4
drizzle-orm incremental 0.524 β†’ 0.527 6,120,273,075.5 β†’ 6,110,878,507.5 0.175 β†’ 0.172 344.9 β†’ 345.2
typeorm check 0.589 β†’ 0.584 6,387,284,980 β†’ 6,377,302,280 0.138 β†’ 0.136 227.1 β†’ 226.7
typeorm incremental 0.633 β†’ 0.636 6,776,443,025.5 β†’ 6,766,564,588.5 0.163 β†’ 0.176 233.7 β†’ 231.6
date-fns check 0.275 β†’ 0.278 3,341,756,856.5 β†’ 3,338,358,081.5 0.083 β†’ 0.084 152.4 β†’ 151.5
date-fns incremental 0.307 β†’ 0.304 3,577,215,124 β†’ 3,574,935,599.5 0.143 β†’ 0.142 163.5 β†’ 163.6

tsrs-lint

Release tsrs-lint linting each project's source files with all 61 rules. After a warmup run of each binary, alternating main/PR pairs (10 per mode) measure wall time, CPU time and peak RSS with TSRS_FAST unset and with TSRS_FAST=1.

Project Mode Wall time Ξ” CPU time Ξ” Peak RSS Ξ” Diagnostics (main β†’ PR)
webpack default +1.2% +0.7% -0.3% 35405, identical
webpack TSRS_FAST=1 -3.5% -1.1% 0.0% 35405, identical
drizzle-orm default +2.7% +1.8% 0.0% 7057, identical
drizzle-orm TSRS_FAST=1 +3.6% +1.2% +0.1% 7057, identical
xstate-main default -0.2% +1.8% +0.6% 6489, identical
xstate-main TSRS_FAST=1 +1.2% +1.3% +0.6% 6489, identical

Negative means the PR used less. Wall and CPU time deltas are medians of paired PR/main ratios; peak RSS compares medians.

Measured lint medians (main β†’ PR)
Project Mode Wall time (s) CPU time (s) Peak RSS (MiB)
webpack default 0.372 β†’ 0.381 1.898 β†’ 1.934 465.9 β†’ 464.4
webpack TSRS_FAST=1 0.382 β†’ 0.367 1.925 β†’ 1.917 464.8 β†’ 464.9
drizzle-orm default 0.226 β†’ 0.229 1.194 β†’ 1.221 402.8 β†’ 402.7
drizzle-orm TSRS_FAST=1 0.223 β†’ 0.230 1.207 β†’ 1.226 404.0 β†’ 404.3
xstate-main default 0.313 β†’ 0.312 1.363 β†’ 1.387 342.2 β†’ 344.4
xstate-main TSRS_FAST=1 0.311 β†’ 0.314 1.356 β†’ 1.375 342.1 β†’ 344.2

The checker's dense link stores sent reserved ids past Go's 16M page
limit to hash maps behind cold calls. The counters are process-wide, so
a large program crosses the limit as checkers are added, and every
lookup past it paid for the hash. Rust's reserved ids stop at 2^31 (the
AST's 31-bit field, asserted by the generator), so the dense tables now
cover the whole range; the ids themselves do not change. The
try_get_if_id_assigned branches for reserved ids past the dense range
are gone.

The index costs 4 bytes per 128 symbol ids and per 1,024 node ids per
store, 64 MiB and 8 MiB at the top of the range. tsrs_core's generic
PagedLinkStore keeps its limit: it takes arbitrary keys and has no
production user.

On a large private monorepo at 8 checkers: wall -2.2%, CPU -1.8%,
instructions -0.5%, peak RSS -3.6%; 4 and 16 checkers in
notes/perf-dense-link-id-cap.md. No catalog project reaches the old
limit; vscode and mui-docs counters and output are identical.
@maschwenk
maschwenk force-pushed the perf/dense-link-id-cap branch from a26257e to 9b394a5 Compare November 28, 2026 21:30
@maschwenk
maschwenk marked this pull request as ready for review November 28, 2026 23:35
@maschwenk
maschwenk added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit c2d1cb1 Nov 28, 2026
73 checks passed
@maschwenk
maschwenk deleted the perf/dense-link-id-cap branch November 28, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant