Skip to content

Reuse token lookup visitor across AST descent - #64928

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
Tom4ikss:reuse-token-lookup-visitor
Oct 29, 2026
Merged

Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
Tom4ikss:reuse-token-lookup-visitor

Conversation

@Tom4ikss

@Tom4ikss Tom S (Tom4ikss) commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

getTokenAtPosition allocates a NodeVisitor and its hooks at each step down the tree. This change reuses one visitor for the duration of each lookup. Child and JSDoc traversal stay the same, and VisitEachChildAndJSDoc keeps its signature. Separate lookups still have separate visitors.

Profiling a tool that makes native API type queries showed repeated visitor allocations in token lookup. This patch did not produce a clear timing improvement in the full workload.

The benchmark looks up an identifier inside 24 nested calls. These are medians of five runs on Go 1.27.1 / darwin-arm64 / Apple M3 Pro:

Before After
Time 6.87 µs/op 1.24 µs/op
Allocated bytes 41,536 B/op 1,664 B/op
Allocations 153/op 13/op

The numbers cover this token lookup only. They do not measure overall compiler performance.

Validation on Node 24.22.1 and npm 11.19.1:

npx hereby generate
npx hereby validate --all
npx hereby test:benchmarks
npx hereby test:benchmarks:api
npm run -w @typescript/typescript build
npm run -w native-preview build
npx hereby check:format

All passed. The tidy checks for both Go modules and go work sync also passed, with a clean working tree afterwards.

To compare the benchmark with the parent revision, apply only the benchmark addition and run this from tsc/:

go test ./internal/astnav -run '^$' -bench BenchmarkGetTokenAtPositionNested -benchmem -count=5

Fixes #64929.

AI assistance: Codex assisted in authoring and testing this patch.

@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Oct 22, 2026
@Tom4ikss

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@jakebailey

Copy link
Copy Markdown
Member

This is a microbenchmark but how did you decide to try and work on this?

@Tom4ikss
Tom S (Tom4ikss) marked this pull request as ready for review October 22, 2026 20:18
Copilot AI balanced review requested due to automatic review settings October 22, 2026 20:18
@typescript-automation

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The localized refactor preserves traversal behavior and per-lookup isolation, with no unresolved findings.

No open issues 🎉

What changed in this PR

Reduces allocation overhead in AST token lookup by reusing one visitor throughout each lookup, while preserving traversal behavior and the public helper signature.

Changes:

  • Moves visitor creation outside the descent loop and introduces an internal helper accepting that visitor.
  • Adds a nested-call benchmark to measure token lookup time and allocations.
File Description
tsc/​internal/​astnav/​tokens.go Reuses a lookup-local visitor without changing child or JSDoc traversal.
tsc/​internal/​astnav/​tokens_test.go Adds a token lookup benchmark with 24 nested calls.

Review effort: Balanced

@Tom4ikss

Copy link
Copy Markdown
Contributor Author

I'm working on a build-time i18n plugin that uses literal unions and template literal types to narrow down which translation keys each bundle needs. Type analysis is the slowest phase of the existing plugin, so I'm experimenting with native API type queries to reduce that cost.

Repeated visitor construction in token lookup showed up in an allocation profile, so I isolated it in this benchmark. I haven't seen a clear timing improvement in the full workload from this patch. The results so far show lower allocations and faster lookups in the microbenchmark.

@typescript-automation typescript-automation Bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 26, 2026
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Oct 26, 2026
@jakebailey Jake Bailey (jakebailey) added the Domain: Performance Reports of unusually slow behavior label Oct 27, 2026
@DanielRosenwasser

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) perf test this

@typescript-automation

typescript-automation Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
perf test this ✅ Started 👀 Results

@typescript-automation

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - native
Errors 41 41 ~ ~ ~ p=1.000 n=20
Symbols 88,466 88,466 ~ ~ ~ p=1.000 n=20
Types 79,607 79,607 ~ ~ ~ p=1.000 n=20
Memory Used 104,132k (± 0.03%) 104,141k (± 0.03%) ~ 104,028k 104,267k p=0.723 n=20
Memory Allocs 2,200,931 (± 0.00%) 2,200,943 (± 0.00%) ~ 2,200,624 2,201,382 p=0.989 n=20
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Parse Time 0.025s (± 3.09%) 0.025s (± 2.35%) ~ 0.022s 0.028s p=0.914 n=20
Bind Time 0.009s (± 4.87%) 0.009s (± 5.70%) ~ 0.007s 0.012s p=0.194 n=20
Check Time 0.230s (± 1.22%) 0.228s (± 0.55%) ~ 0.224s 0.235s p=0.315 n=20
Emit Time 0.160s (± 3.40%) 0.155s (± 1.04%) 🟩-0.005s (- 3.30%) 0.147s 0.163s p=0.005 n=20
Total Time 0.427s (± 1.80%) 0.420s (± 0.49%) -0.007s (- 1.56%) 0.414s 0.432s p=0.006 n=20
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=20
Symbols 586,526 (± 0.02%) 586,522 (± 0.02%) ~ 586,049 586,736 p=1.000 n=20
Types 241,687 (± 0.00%) 241,688 (± 0.00%) ~ 241,685 241,695 p=0.116 n=20
Memory Used 517,974k (± 0.02%) 517,945k (± 0.02%) ~ 517,666k 518,292k p=0.640 n=20
Memory Allocs 13,113,599 (± 0.02%) 13,118,066 (± 0.03%) +4,467 (+ 0.03%) 13,110,361 13,141,118 p=0.005 n=20
Config Time 0.008s (± 1.30%) 0.008s (± 1.77%) ~ 0.008s 0.009s p=1.000 n=20
Parse Time 0.131s (± 1.48%) 0.131s (± 2.48%) ~ 0.122s 0.149s p=0.550 n=20
Bind Time 0.042s (± 6.49%) 0.044s (± 7.54%) ~ 0.039s 0.060s p=0.518 n=20
Check Time 0s 0s ~ ~ ~ p=1.000 n=20
Emit Time 0.926s (± 1.28%) 0.940s (± 4.85%) ~ 0.896s 1.348s p=0.673 n=20
Total Time 1.118s (± 1.06%) 1.136s (± 4.13%) ~ 1.085s 1.559s p=0.867 n=20
arktype - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 685,920 685,920 ~ ~ ~ p=1.000 n=20
Types 939,467 939,467 ~ ~ ~ p=1.000 n=20
Memory Used 497,239k (± 0.01%) 497,280k (± 0.01%) ~ 497,046k 497,446k p=0.194 n=20
Memory Allocs 12,805,091 (± 0.01%) 12,806,082 (± 0.02%) ~ 12,801,380 12,816,208 p=0.565 n=20
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=20
Parse Time 0.044s (± 4.14%) 0.044s (± 3.74%) ~ 0.038s 0.051s p=0.804 n=20
Bind Time 0.013s (± 6.92%) 0.013s (± 8.75%) ~ 0.011s 0.020s p=0.677 n=20
Check Time 0.992s (± 0.75%) 0.988s (± 0.68%) ~ 0.962s 1.021s p=0.409 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 1.081s (± 0.63%) 1.077s (± 0.62%) ~ 1.053s 1.110s p=0.473 n=20
class-transformer - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 45,376 45,376 ~ ~ ~ p=1.000 n=20
Types 7,573 7,573 ~ ~ ~ p=1.000 n=20
Memory Used 27,838k (± 0.02%) 27,836k (± 0.03%) ~ 27,811k 27,864k p=0.693 n=20
Memory Allocs 323,469 (± 0.05%) 323,303 (± 0.04%) ~ 322,920 323,911 p=0.136 n=20
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Parse Time 0.012s (± 5.67%) 0.011s (± 4.86%) ~ 0.009s 0.013s p=0.095 n=20
Bind Time 0.003s (±17.34%) 0.004s (±15.06%) ~ 0.002s 0.005s p=0.240 n=20
Check Time 0.008s (± 4.45%) 0.008s (± 4.98%) ~ 0.007s 0.009s p=0.080 n=20
Emit Time 0.010s (± 4.14%) 0.010s (± 3.93%) ~ 0.008s 0.011s p=0.480 n=20
Total Time 0.034s (± 2.12%) 0.034s (± 1.83%) ~ 0.031s 0.036s p=0.170 n=20
effect - native
Errors 12 12 ~ ~ ~ p=1.000 n=20
Symbols 1,235,115 1,235,115 ~ ~ ~ p=1.000 n=20
Types 894,113 894,113 ~ ~ ~ p=1.000 n=20
Memory Used 940,583k (± 0.03%) 940,627k (± 0.02%) ~ 939,719k 941,479k p=0.678 n=20
Memory Allocs 15,753,633 (± 0.01%) 15,752,298 (± 0.02%) ~ 15,743,204 15,767,117 p=0.461 n=20
Config Time 0.002s 0.002s ~ ~ ~ p=1.000 n=20
Parse Time 0.159s (± 1.59%) 0.161s (± 1.61%) ~ 0.151s 0.175s p=0.255 n=20
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Check Time 0.968s (± 0.82%) 0.975s (± 0.81%) ~ 0.948s 1.007s p=0.273 n=20
Emit Time 0.527s (± 1.56%) 0.517s (± 1.54%) ~ 0.491s 0.556s p=0.068 n=20
Total Time 1.752s (± 0.52%) 1.747s (± 0.65%) ~ 1.692s 1.792s p=0.784 n=20
mui-docs - native
Errors 11,405 11,405 ~ ~ ~ p=1.000 n=20
Symbols 3,784,019 3,784,019 ~ ~ ~ p=1.000 n=20
Types 1,355,974 1,355,974 ~ ~ ~ p=1.000 n=20
Memory Used 1,835,621k (± 0.07%) 1,835,627k (± 0.07%) ~ 1,831,202k 1,842,293k p=0.889 n=20
Memory Allocs 26,746,093 (± 0.07%) 26,733,475 (± 0.05%) ~ 26,702,713 26,806,939 p=0.127 n=20
Config Time 0.008s 0.008s ~ ~ ~ p=1.000 n=20
Parse Time 0.286s (± 2.00%) 0.298s (± 3.34%) ~ 0.272s 0.348s p=0.176 n=20
Bind Time 0.001s 0.001s ~ ~ ~ p=1.000 n=20
Check Time 3.268s (± 0.38%) 3.267s (± 0.42%) ~ 3.225s 3.315s p=0.867 n=20
Emit Time 0.251s (± 1.29%) 0.250s (± 0.94%) ~ 0.241s 0.257s p=0.899 n=20
Total Time 4.311s (± 0.48%) 4.312s (± 0.38%) ~ 4.247s 4.401s p=0.490 n=20
sentry - native
Errors 2 2 ~ ~ ~ p=1.000 n=20
Symbols 4,793,245 4,793,245 ~ ~ ~ p=1.000 n=20
Types 2,607,047 2,607,047 ~ ~ ~ p=1.000 n=20
Memory Used 2,880,437k (± 0.03%) 2,881,031k (± 0.03%) ~ 2,878,755k 2,884,216k p=0.383 n=20
Memory Allocs 75,892,358 (± 0.10%) 75,951,488 (± 0.05%) ~ 75,750,689 76,106,934 p=0.620 n=20
Config Time 0.027s (± 0.91%) 0.027s (± 1.25%) ~ 0.025s 0.028s p=0.452 n=20
Parse Time 0.545s (± 7.10%) 0.485s (± 2.73%) 🟩-0.060s (-11.02%) 0.443s 0.558s p=0.010 n=20
Bind Time 0.162s (±10.04%) 0.176s (± 9.80%) ~ 0.137s 0.240s p=0.159 n=20
Check Time 7.257s (± 0.69%) 7.211s (± 1.13%) ~ 6.874s 7.436s p=0.547 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 8.042s (± 0.84%) 7.952s (± 1.07%) ~ 7.558s 8.212s p=0.183 n=20
social-app - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 1,883,074 1,883,074 ~ ~ ~ p=1.000 n=20
Types 1,158,170 1,158,170 ~ ~ ~ p=1.000 n=20
Memory Used 972,545k (± 0.02%) 972,505k (± 0.02%) ~ 971,839k 973,336k p=0.542 n=20
Memory Allocs 13,720,144 (± 0.21%) 13,745,139 (± 0.17%) ~ 13,666,828 13,836,632 p=0.068 n=20
Config Time 0.008s (± 2.10%) 0.008s (± 1.30%) ~ 0.008s 0.009s p=0.605 n=20
Parse Time 0.166s (± 2.63%) 0.171s (± 3.70%) ~ 0.154s 0.208s p=0.365 n=20
Bind Time 0.049s (±11.20%) 0.048s (±10.66%) ~ 0.037s 0.067s p=0.614 n=20
Check Time 1.660s (± 0.61%) 1.659s (± 0.63%) ~ 1.608s 1.705s p=0.899 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 1.902s (± 0.64%) 1.905s (± 0.72%) ~ 1.854s 1.963s p=0.846 n=20
strada-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 1,184,972 1,184,972 ~ ~ ~ p=1.000 n=20
Types 438,963 438,963 ~ ~ ~ p=1.000 n=20
Memory Used 1,172,549k (± 0.23%) 1,170,473k (± 0.31%) ~ 1,153,966k 1,183,413k p=0.883 n=20
Memory Allocs 77,474,976 (± 0.10%) 77,475,331 (± 0.13%) ~ 76,900,573 77,727,337 p=0.841 n=20
Config Time 0.002s (±15.73%) 0.002s (± 9.43%) ~ 0.001s 0.003s p=0.615 n=20
Parse Time 0.150s (± 1.70%) 0.146s (± 1.84%) ~ 0.135s 0.155s p=0.068 n=20
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Check Time 0.851s (± 0.93%) 0.846s (± 0.62%) ~ 0.827s 0.872s p=0.560 n=20
Emit Time 0.179s (± 1.81%) 0.179s (± 1.69%) ~ 0.166s 0.193s p=0.846 n=20
Total Time 10.342s (± 0.86%) 10.285s (± 0.58%) ~ 10.045s 10.533s p=0.723 n=20
strada-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 263,511 263,511 ~ ~ ~ p=1.000 n=20
Types 196,116 196,116 ~ ~ ~ p=1.000 n=20
Memory Used 224,616k (± 0.02%) 224,601k (± 0.02%) ~ 224,410k 224,743k p=0.597 n=20
Memory Allocs 4,304,849 (± 0.01%) 4,304,976 (± 0.01%) ~ 4,303,272 4,306,753 p=0.738 n=20
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Parse Time 0.052s (± 3.09%) 0.053s (± 3.09%) ~ 0.047s 0.060s p=0.866 n=20
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Check Time 0.410s (± 0.73%) 0.412s (± 1.61%) ~ 0.394s 0.450s p=0.973 n=20
Emit Time 0.084s (± 3.46%) 0.082s (± 2.37%) ~ 0.074s 0.092s p=0.290 n=20
Total Time 0.577s (± 0.58%) 0.577s (± 1.19%) ~ 0.561s 0.613s p=0.379 n=20
t3code-server - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 4,350,661 4,350,661 ~ ~ ~ p=1.000 n=20
Types 3,040,647 3,040,647 ~ ~ ~ p=1.000 n=20
Memory Used 2,433,888k (± 0.03%) 2,434,038k (± 0.03%) ~ 2,431,734k 2,437,349k p=0.779 n=20
Memory Allocs 37,868,293 (± 0.04%) 37,889,354 (± 0.05%) ~ 37,826,172 38,002,889 p=0.081 n=20
Config Time 0.003s 0.003s (± 3.54%) ~ 0.002s 0.003s p=1.000 n=20
Parse Time 0.273s (± 2.23%) 0.270s (± 2.17%) ~ 0.245s 0.294s p=0.357 n=20
Bind Time 0.093s (± 8.71%) 0.094s (± 8.90%) ~ 0.081s 0.141s p=0.672 n=20
Check Time 8.104s (± 1.02%) 8.122s (± 1.17%) ~ 7.769s 8.498s p=0.703 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 8.484s (± 1.02%) 8.500s (± 1.13%) ~ 8.134s 8.869s p=0.764 n=20
tanstack-router - native
Errors 1 1 ~ ~ ~ p=1.000 n=20
Symbols 571,756 571,756 ~ ~ ~ p=1.000 n=20
Types 397,689 397,689 ~ ~ ~ p=1.000 n=20
Memory Used 331,461k (± 0.01%) 331,438k (± 0.01%) ~ 331,251k 331,667k p=0.542 n=20
Memory Allocs 5,099,615 (± 0.15%) 5,093,499 (± 0.05%) ~ 5,087,575 5,112,085 p=0.114 n=20
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=20
Parse Time 0.042s (± 3.99%) 0.044s (± 3.83%) ~ 0.039s 0.049s p=0.391 n=20
Bind Time 0.014s (±11.69%) 0.012s (± 7.89%) ~ 0.011s 0.018s p=0.113 n=20
Check Time 0.585s (± 0.93%) 0.582s (± 0.82%) ~ 0.563s 0.604s p=0.291 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 0.665s (± 0.70%) 0.667s (± 0.85%) ~ 0.640s 0.686s p=0.387 n=20
ts-pre-modules - native
Errors 87 87 ~ ~ ~ p=1.000 n=20
Symbols 231,616 231,616 ~ ~ ~ p=1.000 n=20
Types 181,195 181,195 ~ ~ ~ p=1.000 n=20
Memory Used 193,545k (± 0.01%) 193,552k (± 0.02%) ~ 193,454k 193,669k p=0.723 n=20
Memory Allocs 1,373,495 (± 0.02%) 1,373,375 (± 0.01%) ~ 1,372,814 1,374,386 p=0.465 n=20
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Parse Time 0.047s (± 2.91%) 0.047s (± 2.55%) ~ 0.041s 0.050s p=0.641 n=20
Bind Time 0.023s (±13.02%) 0.022s (± 4.66%) ~ 0.020s 0.027s p=0.919 n=20
Check Time 0.324s (± 2.09%) 0.322s (± 1.02%) ~ 0.307s 0.333s p=0.815 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 0.400s (± 2.33%) 0.397s (± 0.86%) ~ 0.378s 0.408s p=0.634 n=20
vscode - native
Errors 11 11 ~ ~ ~ p=1.000 n=20
Symbols 7,414,524 7,414,524 ~ ~ ~ p=1.000 n=20
Types 4,356,679 4,356,679 ~ ~ ~ p=1.000 n=20
Memory Used 5,151,228k (± 0.02%) 5,151,618k (± 0.02%) ~ 5,148,269k 5,155,258k p=0.640 n=20
Memory Allocs 65,097,340 (± 0.03%) 65,092,666 (± 0.02%) ~ 65,073,767 65,158,755 p=0.758 n=20
Config Time 0.034s (± 1.25%) 0.034s (± 1.29%) ~ 0.033s 0.036s p=0.655 n=20
Parse Time 0.950s (± 1.90%) 0.951s (± 2.61%) ~ 0.860s 1.076s p=0.836 n=20
Bind Time 0.313s (± 3.38%) 0.322s (± 5.79%) ~ 0.296s 0.467s p=0.794 n=20
Check Time 7.704s (± 1.04%) 7.667s (± 0.85%) ~ 7.484s 7.984s p=0.588 n=20
Emit Time 2.951s (± 4.08%) 2.963s (± 4.63%) ~ 2.755s 3.752s p=0.763 n=20
Total Time 12.015s (± 1.08%) 11.998s (± 1.37%) ~ 11.555s 12.787s p=0.644 n=20
webpack - native
Errors 619 619 ~ ~ ~ p=1.000 n=20
Symbols 926,331 926,331 ~ ~ ~ p=1.000 n=20
Types 646,440 646,440 ~ ~ ~ p=1.000 n=20
Memory Used 698,502k (± 0.01%) 698,603k (± 0.01%) ~ 698,264k 698,945k p=0.127 n=20
Memory Allocs 6,690,874 (± 0.04%) 6,689,327 (± 0.03%) ~ 6,685,053 6,704,623 p=0.183 n=20
Config Time 0.004s 0.004s ~ ~ ~ p=1.000 n=20
Parse Time 0.149s (± 3.67%) 0.151s (± 3.39%) ~ 0.133s 0.172s p=0.569 n=20
Bind Time 0.048s (± 8.07%) 0.049s (± 7.69%) ~ 0.041s 0.069s p=0.692 n=20
Check Time 1.279s (± 1.00%) 1.272s (± 1.16%) ~ 1.231s 1.320s p=0.516 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 1.507s (± 1.19%) 1.501s (± 1.04%) ~ 1.458s 1.558s p=0.606 n=20
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=20
Symbols 640,490 640,490 ~ ~ ~ p=1.000 n=20
Types 387,988 387,988 ~ ~ ~ p=1.000 n=20
Memory Used 350,937k (± 0.02%) 350,993k (± 0.03%) ~ 350,713k 351,457k p=0.445 n=20
Memory Allocs 4,069,686 (± 0.05%) 4,066,055 (± 0.08%) -3,631 (- 0.09%) 4,053,618 4,080,050 p=0.040 n=20
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=20
Parse Time 0.063s (± 2.41%) 0.061s (± 2.89%) 🟩-0.002s (- 3.25%) 0.056s 0.071s p=0.025 n=20
Bind Time 0.018s (± 9.96%) 0.019s (± 8.10%) ~ 0.017s 0.027s p=0.150 n=20
Check Time 0.413s (± 0.67%) 0.413s (± 0.75%) ~ 0.403s 0.425s p=0.963 n=20
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=20
Total Time 0.501s (± 0.93%) 0.500s (± 0.67%) ~ 0.490s 0.512s p=0.952 n=20
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • arktype - native
  • class-transformer - native
  • effect - native
  • mui-docs - native
  • sentry - native
  • social-app - native
  • strada-build-src - native
  • strada-compiler - native
  • t3code-server - native
  • tanstack-router - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 20
Baseline baseline 20

lsp

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
CompilerLSP - native
Req 1 - updateOpen 5ms (±16.88%) 5ms (±13.53%) ~ 4ms 8ms p=1.000 n=20
Req 2 - geterr 152ms (± 0.61%) 153ms (± 0.87%) ~ 149ms 160ms p=0.202 n=20
Req 3 - references 30ms (± 2.40%) 26ms (± 1.75%) 🟩-4ms (-13.04%) 25ms 29ms p=0.000 n=20
Req 4 - navto 14ms (± 5.03%) 13ms (± 2.02%) 🟩-1ms (- 6.81%) 12ms 14ms p=0.023 n=20
Req 5 - completionInfo count 1,525 1,525 ~ ~ ~ p=1.000 n=20
Req 5 - completionInfo 9ms (±12.38%) 12ms (± 9.44%) 🔻+2ms (+25.00%) 8ms 14ms p=0.003 n=20
Compiler-UnionsLSP - native
Req 1 - updateOpen 5ms (±13.70%) 5ms (±11.27%) ~ 4ms 7ms p=0.932 n=20
Req 2 - geterr 256ms (± 0.42%) 255ms (± 0.57%) ~ 251ms 265ms p=0.147 n=20
Req 3 - references 28ms (± 2.88%) 25ms (± 3.92%) 🟩-3ms (-10.87%) 22ms 28ms p=0.000 n=20
Req 4 - navto 12ms (± 2.77%) 12ms (± 3.29%) ~ 11ms 14ms p=0.089 n=20
Req 5 - completionInfo count 1,363 1,363 ~ ~ ~ p=1.000 n=20
Req 5 - completionInfo 8ms (± 8.12%) 8ms (±11.19%) ~ 7ms 13ms p=0.106 n=20
xstate-main-1-LSP - native
⚠️ Failed failed failed
System info unknown
Hosts
  • native
Scenarios
  • CompilerLSP - native
  • Compiler-UnionsLSP - native
  • xstate-main-1-LSP - native
Benchmark Name Iterations
Current pr 20
Baseline baseline 20

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
lsp-startup - native
⚠️ Failed failed failed
tsgo-startup - native
⚠️ Failed failed failed
System info unknown
Hosts
  • native
Scenarios
  • lsp-startup - native
  • tsgo-startup - native
Benchmark Name Iterations
Current pr 20
Baseline baseline 20

Developer Information:

Download Benchmarks

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Oct 29, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Oct 29, 2026
Merged via the queue into microsoft:main with commit b59ba46 Oct 29, 2026
29 checks passed
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Domain: Performance Reports of unusually slow behavior For Backlog Bug PRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Native token lookup allocates a visitor on each AST descent step

4 participants