Skip to content

perf(lint): parse each tsconfig and extended config once per request - #1086

Merged
camc314 merged 3 commits into
mainfrom
perf/lint-config-parse-once
Nov 25, 2026
Merged

camc314 merged 3 commits into
mainfrom
perf/lint-config-parse-once

Conversation

@camc314

@camc314 camc314 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A headless lint request parsed each tsconfig and its whole extends chain up to three times per program: in discovery, while building the program and while parsing project references. When the shared base config holds a large paths map, every program paid for that parse and kept its own copy.
  • Shared now implements ExtendedConfigCache. Discovery, the program parse and project-reference parsing share one parsed entry per extended config, kept in a request-owned region.
  • run_in_region passes the discovery ParsedCommandLine to lint_program when its config name matches the normalized config path. Otherwise the program is parsed as before.

Measurements

Synthetic workspace: a shared base config with 1,868 paths aliases and two programs per project. Release builds on Apple Silicon with 12 logical CPUs; medians of five interleaved runs. Peak memory is the peak physical footprint.

programs threads wall CPU time peak memory instructions
200 default 0.61s β†’ 0.19s 1.54s β†’ 0.88s 854 β†’ 68 MiB 12.5G β†’ 5.6G
800 default 2.43s β†’ 0.71s 6.32s β†’ 3.30s 3,207 β†’ 83 MiB 49.7G β†’ 21.4G
1,600 default 5.25s β†’ 1.41s 12.17s β†’ 6.62s 6,348 β†’ 102 MiB 97.2G β†’ 42.2G
800 1 3.23s β†’ 1.05s 3.29s β†’ 1.13s 3,150 β†’ 31 MiB 39.4G β†’ 13.0G
800 4 3.70s β†’ 1.44s 4.92s β†’ 2.66s 3,159 β†’ 40 MiB 46.7G β†’ 20.3G

Refs #1016

@codspeed

codspeed Bot commented Nov 24, 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/lint-config-parse-once (d88734c) with main (4ffdb88)

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 24, 2026 •

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run Β· main 96fbb8d499d2 β†’ PR merge b2fe789c172d (head d88734cfb045)

Clef gate: Running benchmarks because the decision was unavailable (crates/tsrs_lint/src/engine.rs: patch exceeds the Clef context limit (5788 bytes)).

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.8% +0.001% 0.0% +0.2%
vscode incremental +1.0% -0.001% 0.0% +0.2%
xstate-main check -0.6% -0.001% +0.8% +0.3%
xstate-main incremental -0.6% -0.001% -1.9% -0.1%
webpack check -0.1% 0.000% -1.9% +0.2%
webpack incremental -0.1% -0.001% -0.2% -0.1%
mui-docs check 0.0% +0.002% -2.8% -2.2%
mui-docs incremental -0.9% +0.004% +1.6% +0.3%
Compiler check +0.7% 0.000% -2.4% 0.0%
Compiler incremental +0.8% 0.000% +1.2% -0.1%
Compiler-Unions check -0.5% 0.000% -0.8% -0.5%
Compiler-Unions incremental +1.2% 0.000% +1.0% -0.2%
cal-diy check +1.1% -0.001% -3.0% +0.3%
cal-diy incremental -0.3% +0.003% -0.2% -0.1%
formbricks-web check -1.0% +0.003% +0.2% +0.1%
formbricks-web incremental +1.8% +0.001% +0.3% 0.0%
supabase-studio check 0.0% -0.004% 0.0% 0.0%
supabase-studio incremental -0.3% +0.002% -0.4% -0.1%
t3code-server check +0.2% +0.002% +2.4% -0.1%
t3code-server incremental -0.3% +0.001% -0.5% +0.1%
mikro-orm check -1.2% +0.001% +0.2% -0.8%
mikro-orm incremental +1.0% -0.002% -2.9% +0.1%
next-packages-next check +3.6% -0.001% -0.7% -0.1%
next-packages-next incremental -0.8% +0.001% +3.6% +0.5%
next-root check 0.0% -0.002% -1.7% -0.6%
next-root incremental -0.4% -0.001% 0.0% -0.2%
storybook check +0.6% 0.000% -2.5% +0.4%
storybook incremental +0.1% +0.001% -3.6% +0.6%
nuxt check +0.1% +0.001% -1.0% -0.2%
nuxt incremental -0.8% +0.001% -2.8% +0.1%
playwright check -0.4% -0.001% -7.1% -0.1%
playwright incremental +0.8% +0.001% +0.4% +0.2%
drizzle-orm check +1.4% +0.001% -4.7% -1.2%
drizzle-orm incremental -0.6% +0.001% -1.4% 0.0%
typeorm check -1.1% -0.001% -1.4% -0.1%
typeorm incremental -0.1% 0.000% -0.5% -0.6%
date-fns check +0.7% -0.002% -1.6% -0.4%
date-fns incremental +1.0% -0.010% +2.1% +0.4%

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 9.208 β†’ 9.401 82,266,257,497 β†’ 82,266,832,309 1.452 β†’ 1.448 1837.2 β†’ 1841.1
vscode incremental 9.593 β†’ 9.584 84,682,868,622.5 β†’ 84,683,090,384.5 1.663 β†’ 1.648 2159.7 β†’ 2163.8
xstate-main check 0.577 β†’ 0.576 5,566,833,372 β†’ 5,566,768,228 0.137 β†’ 0.137 242.0 β†’ 242.9
xstate-main incremental 0.538 β†’ 0.536 5,728,519,787 β†’ 5,728,474,605.5 0.162 β†’ 0.159 245.3 β†’ 245.0
webpack check 0.917 β†’ 0.914 10,885,429,252 β†’ 10,885,792,073 0.198 β†’ 0.200 404.5 β†’ 405.4
webpack incremental 0.955 β†’ 0.954 11,109,368,488 β†’ 11,109,051,127.5 0.243 β†’ 0.242 403.5 β†’ 403.3
mui-docs check 2.376 β†’ 2.374 33,106,707,686 β†’ 33,106,912,097 0.976 β†’ 0.944 1237.0 β†’ 1210.2
mui-docs incremental 2.926 β†’ 2.894 34,467,841,074 β†’ 34,466,445,869.5 1.135 β†’ 1.165 1160.9 β†’ 1164.9
Compiler check 0.149 β†’ 0.152 1,775,529,942 β†’ 1,775,532,971 0.069 β†’ 0.070 77.9 β†’ 77.9
Compiler incremental 0.161 β†’ 0.164 1,789,916,021 β†’ 1,789,924,670 0.070 β†’ 0.070 80.0 β†’ 79.9
Compiler-Unions check 0.193 β†’ 0.191 3,053,259,455.5 β†’ 3,053,242,488 0.093 β†’ 0.094 81.6 β†’ 81.2
Compiler-Unions incremental 0.216 β†’ 0.218 3,064,796,548.5 β†’ 3,064,791,057.5 0.099 β†’ 0.101 85.3 β†’ 85.1
cal-diy check 3.474 β†’ 3.473 28,974,961,378 β†’ 28,975,373,921.5 1.111 β†’ 1.118 1351.3 β†’ 1355.6
cal-diy incremental 3.083 β†’ 3.026 30,595,133,800.5 β†’ 30,596,622,446 1.081 β†’ 1.083 1266.8 β†’ 1266.0
formbricks-web check 3.477 β†’ 3.474 37,088,282,970 β†’ 37,089,389,486 0.855 β†’ 0.858 1580.2 β†’ 1582.0
formbricks-web incremental 4.036 β†’ 4.138 39,693,761,642.5 β†’ 39,693,862,923.5 1.363 β†’ 1.377 1624.4 β†’ 1624.1
supabase-studio check 3.716 β†’ 3.648 40,827,171,480 β†’ 40,825,058,130.5 0.933 β†’ 0.944 1307.6 β†’ 1308.1
supabase-studio incremental 4.178 β†’ 4.165 43,773,356,249.5 β†’ 43,773,447,765 1.145 β†’ 1.136 1367.0 β†’ 1365.2
t3code-server check 3.902 β†’ 3.997 41,058,160,816.5 β†’ 41,058,208,379.5 1.710 β†’ 1.742 1444.6 β†’ 1442.5
t3code-server incremental 3.980 β†’ 3.984 41,583,801,649 β†’ 41,586,193,110.5 1.671 β†’ 1.644 1302.9 β†’ 1304.5
mikro-orm check 4.626 β†’ 4.501 44,486,246,002.5 β†’ 44,485,941,715 0.907 β†’ 0.905 1291.0 β†’ 1280.8
mikro-orm incremental 4.464 β†’ 4.502 44,796,489,570.5 β†’ 44,795,862,424 1.307 β†’ 1.269 1257.2 β†’ 1257.9
next-packages-next check 1.612 β†’ 1.665 17,406,356,937 β†’ 17,406,115,544 0.410 β†’ 0.404 560.1 β†’ 559.4
next-packages-next incremental 1.567 β†’ 1.538 17,732,656,240 β†’ 17,733,011,942 0.449 β†’ 0.463 564.0 β†’ 566.8
next-root check 1.280 β†’ 1.263 13,996,476,141 β†’ 13,996,183,558 0.274 β†’ 0.273 431.8 β†’ 429.3
next-root incremental 1.217 β†’ 1.212 14,458,906,294 β†’ 14,458,719,378.5 0.309 β†’ 0.308 474.9 β†’ 473.8
storybook check 0.777 β†’ 0.775 8,867,601,763 β†’ 8,867,549,752 0.216 β†’ 0.205 398.7 β†’ 400.1
storybook incremental 0.965 β†’ 0.945 9,193,185,467.5 β†’ 9,196,615,032 0.296 β†’ 0.286 373.8 β†’ 375.9
nuxt check 0.811 β†’ 0.811 8,502,272,061 β†’ 8,502,152,408 0.210 β†’ 0.210 390.3 β†’ 389.6
nuxt incremental 1.413 β†’ 1.406 8,904,620,137 β†’ 8,904,707,012 0.398 β†’ 0.387 391.3 β†’ 391.7
playwright check 0.802 β†’ 0.796 7,403,508,723 β†’ 7,403,427,247 0.196 β†’ 0.185 364.2 β†’ 363.8
playwright incremental 0.765 β†’ 0.769 7,576,707,056.5 β†’ 7,576,824,887.5 0.197 β†’ 0.201 339.2 β†’ 339.8
drizzle-orm check 0.580 β†’ 0.587 5,948,604,587.5 β†’ 5,948,833,350 0.183 β†’ 0.179 383.7 β†’ 378.9
drizzle-orm incremental 0.543 β†’ 0.534 6,120,270,969.5 β†’ 6,120,447,664.5 0.177 β†’ 0.177 345.4 β†’ 345.5
typeorm check 0.595 β†’ 0.590 6,398,361,823.5 β†’ 6,398,343,489 0.136 β†’ 0.137 227.2 β†’ 227.0
typeorm incremental 0.630 β†’ 0.629 6,776,108,445.5 β†’ 6,776,188,422.5 0.164 β†’ 0.163 234.5 β†’ 233.0
date-fns check 0.276 β†’ 0.278 3,352,441,234 β†’ 3,352,398,022 0.085 β†’ 0.085 152.7 β†’ 152.1
date-fns incremental 0.366 β†’ 0.367 3,590,252,317 β†’ 3,589,094,921.5 0.187 β†’ 0.186 163.4 β†’ 164.0

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 +0.7% +0.3% 0.0% 35405, identical
webpack TSRS_FAST=1 -0.2% +0.3% -0.2% 35405, identical
drizzle-orm default -2.8% 0.0% +0.1% 7057, identical
drizzle-orm TSRS_FAST=1 +0.9% -0.4% -0.1% 7057, identical
xstate-main default -1.2% -1.2% -0.1% 6489, identical
xstate-main TSRS_FAST=1 +0.3% +0.4% +0.1% 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.358 β†’ 0.360 1.853 β†’ 1.873 463.8 β†’ 463.9
webpack TSRS_FAST=1 0.362 β†’ 0.362 1.863 β†’ 1.874 464.2 β†’ 463.3
drizzle-orm default 0.225 β†’ 0.221 1.199 β†’ 1.195 403.3 β†’ 403.7
drizzle-orm TSRS_FAST=1 0.222 β†’ 0.222 1.185 β†’ 1.198 404.1 β†’ 403.9
xstate-main default 0.322 β†’ 0.316 1.419 β†’ 1.388 341.0 β†’ 340.7
xstate-main TSRS_FAST=1 0.317 β†’ 0.319 1.388 β†’ 1.397 342.1 β†’ 342.6

@camc314
camc314 marked this pull request as ready for review November 24, 2026 22:34
Copilot AI balanced review requested due to automatic review settings November 24, 2026 22:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: βœ… Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
πŸ“ Code Review βœ… Completed 2026-11-24T22:36:21.150242Z 153efb1 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with πŸ‘€ while any review is running, comments if it has suggestions, and reacts with πŸ‘ once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 153efb1e5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/tsrs_lint/src/engine.rs Resolved
@camc314
camc314 enabled auto-merge November 25, 2026 09:44
@camc314
camc314 added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 64bd6bf Nov 25, 2026
83 of 85 checks passed
@camc314
camc314 deleted the perf/lint-config-parse-once branch November 25, 2026 09:58
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.

2 participants