Skip to content

perf(checker): cut type-fest check time ~29% with ordered array mappers and bulk tuple spreads - #1127

Merged
maschwenk merged 1 commit into
mainfrom
perf/ordered-array-mappers-tuple-spreads
Nov 28, 2026
Merged

maschwenk merged 1 commit into
mainfrom
perf/ordered-array-mappers-tuple-spreads

Conversation

@maschwenk

@maschwenk maschwenk commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

on type-fest, TypeMapper::map linearly scanned long array mappers on every lookup, and TupleNormalizer copied all-required tuple spreads one element at a time. new_array_type_mapper now puts lists of 32+ sources with strictly increasing type ids into an out-of-line OrderedArray variant that binary-searches by id and confirms the handle matches. TupleNormalizer copies all-required spreads in bulk and stops its optional-to-required fixup loop at the last optional or rest element. no new unsafe sites, and adds the long-array-mapper and required-tuple-spread regression fixtures matching pinned tsgo.

type-fest (x86_64, 16 pairs, --noEmit --incremental false) and CI catalog:

workload wall instructions peak RSS
type-fest default checkers 2.43s -> 1.72s (-29.1%) -30.7% +0.1%
type-fest single-threaded 3.48s -> 2.73s (-21.6%) -31.5% flat
type-fest --fast 1.08s -> 0.61s (-42.8%) -32.8% flat
19 CI catalog projects flat (t3code-server -0.6%) within Β±0.03% flat

@codspeed

codspeed Bot commented Nov 28, 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/ordered-array-mappers-tuple-spreads (83adf2f) 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 28, 2026 •

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run Β· main 13db50241e4f β†’ PR merge b8ab38bc8878 (head 83adf2f4452d)

Clef gate: Clef estimated 84.6% default and single-threaded wall time, 70.4% peak RSS, 95.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.2% -0.006% +0.2% 0.0%
vscode incremental +0.2% -0.004% -0.1% 0.0%
xstate-main check +0.3% -0.008% -0.9% +0.3%
xstate-main incremental -0.4% -0.008% -0.1% -0.3%
webpack check -0.2% +0.001% +1.3% 0.0%
webpack incremental -0.3% +0.002% +0.6% +0.4%
mui-docs check +0.4% +0.004% +0.3% -0.1%
mui-docs incremental +0.2% -0.009% -0.1% +0.1%
Compiler check -0.3% +0.001% +1.6% +0.3%
Compiler incremental -0.9% +0.001% +0.6% -0.1%
Compiler-Unions check -0.5% +0.001% -1.1% +0.1%
Compiler-Unions incremental +0.5% +0.001% +1.3% -0.3%
cal-diy check -0.7% -0.014% -0.8% +0.2%
cal-diy incremental +0.4% -0.011% +0.1% +0.1%
formbricks-web check 0.0% +0.004% +0.3% +0.1%
formbricks-web incremental 0.0% -0.001% -0.7% +0.2%
supabase-studio check -0.2% -0.005% -0.6% -0.1%
supabase-studio incremental +0.1% 0.000% 0.0% +0.1%
t3code-server check -0.3% +0.001% -1.1% -0.1%
t3code-server incremental +0.2% -0.009% -0.2% +0.1%
mikro-orm check +0.1% -0.007% -0.2% -0.2%
mikro-orm incremental 0.0% -0.006% -1.0% -0.2%
next-packages-next check -0.4% 0.000% +0.9% +0.3%
next-packages-next incremental -0.2% -0.002% -0.8% -0.2%
next-root check -0.8% -0.001% -1.2% +0.1%
next-root incremental -0.6% +0.003% -0.5% +0.1%
storybook check -0.2% +0.001% -2.0% +0.1%
storybook incremental +0.7% -0.001% -1.1% 0.0%
nuxt check -0.5% +0.001% -1.9% -0.4%
nuxt incremental -0.1% -0.004% -1.3% +0.1%
playwright check -0.6% +0.005% +1.0% +1.5%
playwright incremental -0.3% +0.004% +0.8% 0.0%
drizzle-orm check +0.6% -0.004% +1.6% -0.4%
drizzle-orm incremental -0.1% -0.008% -1.5% +0.1%
typeorm check +0.9% 0.000% -2.8% -0.5%
typeorm incremental +0.9% -0.004% +0.4% -0.6%
date-fns check 0.0% +0.002% +1.7% +0.9%
date-fns incremental -0.7% +0.009% +0.7% +0.3%

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.364 β†’ 8.381 82,264,448,738.5 β†’ 82,259,345,597 1.459 β†’ 1.459 1841.7 β†’ 1842.4
vscode incremental 8.830 β†’ 8.861 84,679,426,712.5 β†’ 84,676,114,916.5 1.713 β†’ 1.715 2160.5 β†’ 2160.4
xstate-main check 0.509 β†’ 0.511 5,566,838,030.5 β†’ 5,566,461,907 0.126 β†’ 0.125 241.7 β†’ 242.5
xstate-main incremental 0.529 β†’ 0.527 5,728,625,979.5 β†’ 5,728,137,060.5 0.158 β†’ 0.157 243.6 β†’ 242.9
webpack check 0.910 β†’ 0.910 10,881,943,303 β†’ 10,881,727,541 0.196 β†’ 0.198 404.7 β†’ 404.6
webpack incremental 0.953 β†’ 0.953 11,105,087,208.5 β†’ 11,105,534,370 0.247 β†’ 0.247 402.2 β†’ 403.8
mui-docs check 2.389 β†’ 2.396 33,107,708,432 β†’ 33,109,504,027.5 0.976 β†’ 0.955 1232.7 β†’ 1231.6
mui-docs incremental 2.509 β†’ 2.508 34,465,254,925 β†’ 34,465,746,001.5 1.112 β†’ 1.093 1161.4 β†’ 1162.6
Compiler check 0.139 β†’ 0.138 1,775,261,931 β†’ 1,775,272,598 0.064 β†’ 0.065 76.8 β†’ 77.0
Compiler incremental 0.142 β†’ 0.142 1,789,627,391 β†’ 1,789,653,902 0.064 β†’ 0.065 79.6 β†’ 79.5
Compiler-Unions check 0.194 β†’ 0.195 3,052,438,782.5 β†’ 3,052,445,669.5 0.091 β†’ 0.091 81.1 β†’ 81.2
Compiler-Unions incremental 0.197 β†’ 0.197 3,065,134,723.5 β†’ 3,065,142,645 0.093 β†’ 0.094 85.2 β†’ 85.0
cal-diy check 2.574 β†’ 2.553 28,972,044,522.5 β†’ 28,968,209,080.5 0.826 β†’ 0.821 1352.6 β†’ 1355.7
cal-diy incremental 2.730 β†’ 2.734 30,592,469,397 β†’ 30,588,552,055 1.028 β†’ 1.030 1266.2 β†’ 1267.5
formbricks-web check 3.403 β†’ 3.402 37,094,266,183 β†’ 37,095,764,276 0.884 β†’ 0.886 1581.2 β†’ 1582.7
formbricks-web incremental 3.541 β†’ 3.535 39,693,409,396 β†’ 39,693,849,121 1.080 β†’ 1.067 1622.1 β†’ 1625.0
supabase-studio check 3.585 β†’ 3.588 40,828,151,754 β†’ 40,826,889,183.5 0.904 β†’ 0.900 1308.7 β†’ 1307.7
supabase-studio incremental 3.860 β†’ 3.862 43,776,831,153 β†’ 43,777,300,840.5 1.043 β†’ 1.041 1362.5 β†’ 1363.5
t3code-server check 3.559 β†’ 3.557 41,064,314,014 β†’ 41,064,047,332.5 1.610 β†’ 1.589 1445.7 β†’ 1444.9
t3code-server incremental 3.597 β†’ 3.584 41,580,199,273.5 β†’ 41,575,239,956 1.405 β†’ 1.404 1306.3 β†’ 1308.1
mikro-orm check 4.077 β†’ 4.085 44,479,815,889.5 β†’ 44,476,616,169 0.860 β†’ 0.865 1283.5 β†’ 1280.5
mikro-orm incremental 4.227 β†’ 4.222 44,791,565,986 β†’ 44,788,626,571 1.108 β†’ 1.098 1258.9 β†’ 1256.3
next-packages-next check 1.453 β†’ 1.450 17,417,136,288.5 β†’ 17,417,199,787.5 0.358 β†’ 0.360 559.7 β†’ 561.2
next-packages-next incremental 1.619 β†’ 1.615 17,733,123,706.5 β†’ 17,732,838,963 0.491 β†’ 0.486 564.7 β†’ 563.4
next-root check 1.168 β†’ 1.160 13,996,343,723 β†’ 13,996,265,692.5 0.257 β†’ 0.256 432.5 β†’ 432.9
next-root incremental 1.226 β†’ 1.220 14,458,938,053 β†’ 14,459,302,216 0.315 β†’ 0.312 472.7 β†’ 473.3
storybook check 0.770 β†’ 0.768 8,867,903,242.5 β†’ 8,867,999,383 0.199 β†’ 0.198 396.9 β†’ 397.2
storybook incremental 0.801 β†’ 0.804 9,193,240,420.5 β†’ 9,192,607,323.5 0.242 β†’ 0.237 374.4 β†’ 374.5
nuxt check 0.820 β†’ 0.818 8,503,001,762 β†’ 8,503,221,780 0.216 β†’ 0.214 390.7 β†’ 389.1
nuxt incremental 0.870 β†’ 0.869 8,906,632,362.5 β†’ 8,906,322,372 0.234 β†’ 0.233 392.0 β†’ 392.5
playwright check 0.665 β†’ 0.665 7,403,317,449.5 β†’ 7,403,681,251.5 0.172 β†’ 0.179 359.1 β†’ 364.4
playwright incremental 0.695 β†’ 0.693 7,581,656,732.5 β†’ 7,582,008,190 0.191 β†’ 0.197 339.6 β†’ 339.5
drizzle-orm check 0.516 β†’ 0.520 5,948,487,164 β†’ 5,948,355,506 0.171 β†’ 0.173 381.0 β†’ 379.4
drizzle-orm incremental 0.530 β†’ 0.529 6,120,214,575.5 β†’ 6,119,745,382 0.177 β†’ 0.175 345.2 β†’ 345.4
typeorm check 0.585 β†’ 0.584 6,387,241,713.5 β†’ 6,387,241,174.5 0.137 β†’ 0.132 228.0 β†’ 226.8
typeorm incremental 0.637 β†’ 0.642 6,776,532,458.5 β†’ 6,776,202,878.5 0.179 β†’ 0.175 234.4 β†’ 233.1
date-fns check 0.271 β†’ 0.271 3,340,938,279 β†’ 3,341,080,333.5 0.082 β†’ 0.086 151.9 β†’ 153.2
date-fns incremental 0.305 β†’ 0.304 3,577,321,978.5 β†’ 3,578,382,232.5 0.147 β†’ 0.148 163.2 β†’ 163.7

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.1% -0.8% 0.0% 35405, identical
webpack TSRS_FAST=1 +1.3% +0.8% +0.1% 35405, identical
drizzle-orm default -0.4% +0.3% -0.1% 7057, identical
drizzle-orm TSRS_FAST=1 -0.3% -0.5% 0.0% 7057, identical
xstate-main default -0.8% -0.8% +0.1% 6489, identical
xstate-main TSRS_FAST=1 -1.8% -0.9% +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.362 β†’ 0.356 1.866 β†’ 1.859 464.6 β†’ 464.7
webpack TSRS_FAST=1 0.359 β†’ 0.365 1.870 β†’ 1.886 465.4 β†’ 465.7
drizzle-orm default 0.220 β†’ 0.218 1.168 β†’ 1.180 403.6 β†’ 403.0
drizzle-orm TSRS_FAST=1 0.222 β†’ 0.218 1.178 β†’ 1.175 403.9 β†’ 403.9
xstate-main default 0.316 β†’ 0.312 1.396 β†’ 1.379 343.0 β†’ 343.4
xstate-main TSRS_FAST=1 0.318 β†’ 0.313 1.392 β†’ 1.377 342.1 β†’ 344.2

@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 1e842dc Nov 28, 2026
73 checks passed
@maschwenk
maschwenk deleted the perf/ordered-array-mappers-tuple-spreads branch November 28, 2026 23:42
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.

1 participant