Repository navigation
perf(checker): keep reserved link ids dense past 16M - #975
Conversation
Merging this PR will not alter performanceWarning 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
Comparing Footnotes
|
Performance change vs mainWorkflow run Β· main 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.
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)
tsrs-lintRelease
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)
|
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.
a26257e to
9b394a5
Compare
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 (
vscodetops out at 9.3M). since Rust's reserved ids already stop at 2^31 (the 31-bit AST tag),MAX_PAGE_LINK_COUNTnow covers the full 31-bit range and the high-id hash fallback branches are gone.tsrs_core::PagedLinkStorekeeps its cap because it takes arbitrary keys and has no production callers.large private monorepo (
--fast,m8g.4xlarge, 15 pairs):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_densein an isolated child process andnotes/perf-dense-link-id-cap.md