Skip to content

Switch to type SymbolName unique.Handle[string] - #64699

Draft
Jake Bailey (jakebailey) wants to merge 3 commits into
microsoft:mainfrom
jakebailey:intern-symbol-names
Draft

Jake Bailey (jakebailey) wants to merge 3 commits into
microsoft:mainfrom
jakebailey:intern-symbol-names

Conversation

@jakebailey

Copy link
Copy Markdown
Member

WIP, slop for testing

Symbols should share canonical names so identity checks and symbol-table
lookups do not repeatedly compare string contents. Preserve textual
behavior for diagnostics, emitted output, and the JavaScript API.
Known names and intermediate name operations should stay interned;
repeated interning and string round trips defeat the canonical
representation in frequently used lookup paths.
Symbol names need their own constructor and representation boundary,
without exposing generic string handles throughout the compiler.

Give name serialization a lossless escaped spelling and distinguish
unset names from valid empty names.
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 8, 2026
@jakebailey

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) perf test this

@typescript-automation

typescript-automation Bot commented Oct 8, 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

Jake Bailey (@jakebailey)
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=12
Symbols 115,276 115,276 ~ ~ ~ p=1.000 n=12
Types 79,613 79,613 ~ ~ ~ p=1.000 n=12
Memory Used 135,310k (± 0.08%) 134,555k (± 0.05%) -754k (- 0.56%) 134,394k 134,762k p=0.000 n=12
Memory Allocs 2,190,636 (± 0.00%) 2,279,198 (± 0.05%) 🔻+88,562 (+ 4.04%) 2,275,969 2,282,067 p=0.000 n=12
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Parse Time 0.050s (± 2.84%) 0.049s (± 3.22%) ~ 0.044s 0.053s p=0.502 n=12
Bind Time 0.015s (±13.33%) 0.030s (± 7.99%) 🔻+0.015s (+99.45%) 0.026s 0.036s p=0.000 n=12
Check Time 0.615s (± 0.71%) 0.612s (± 0.92%) ~ 0.602s 0.630s p=0.162 n=12
Emit Time 0.329s (± 2.14%) 0.338s (± 1.22%) +0.009s (+ 2.68%) 0.324s 0.348s p=0.034 n=12
Total Time 1.018s (± 0.96%) 1.037s (± 0.62%) +0.019s (+ 1.88%) 1.021s 1.057s p=0.001 n=12
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=12
Symbols 845,989 (± 0.05%) 845,729 (± 0.09%) ~ 842,740 847,317 p=0.932 n=12
Types 248,124 (± 0.00%) 248,123 (± 0.00%) ~ 248,122 248,125 p=0.993 n=12
Memory Used 764,653k (± 0.02%) 746,535k (± 0.02%) -18,119k (- 2.37%) 746,119k 746,997k p=0.000 n=12
Memory Allocs 12,925,262 (± 0.06%) 13,352,078 (± 0.04%) +426,816 (+ 3.30%) 13,345,546 13,372,669 p=0.000 n=12
Config Time 0.016s (± 1.97%) 0.017s (± 1.07%) +0.001s (+ 3.05%) 0.016s 0.017s p=0.027 n=12
Parse Time 0.257s (± 2.58%) 0.259s (± 2.82%) ~ 0.234s 0.268s p=0.385 n=12
Bind Time 0.063s (±12.33%) 0.100s (±10.80%) 🔻+0.037s (+59.92%) 0.092s 0.150s p=0.000 n=12
Check Time 0s 0s ~ ~ ~ p=1.000 n=12
Emit Time 1.587s (± 1.21%) 1.626s (± 0.86%) +0.039s (+ 2.45%) 1.594s 1.679s p=0.004 n=12
Total Time 1.937s (± 1.28%) 2.014s (± 0.99%) +0.076s (+ 3.94%) 1.979s 2.101s p=0.000 n=12
mui-docs - native
Errors 11,405 11,405 ~ ~ ~ p=1.000 n=12
Symbols 4,359,614 4,359,614 ~ ~ ~ p=1.000 n=12
Types 1,376,379 1,376,379 ~ ~ ~ p=1.000 n=12
Memory Used 2,874,210k (± 0.05%) 2,568,218k (± 0.05%) 🟩-305,992k (-10.65%) 2,564,693k 2,571,397k p=0.000 n=12
Memory Allocs 32,870,213 (± 0.08%) 33,621,012 (± 0.06%) +750,799 (+ 2.28%) 33,575,749 33,692,494 p=0.000 n=12
Config Time 0.020s (± 1.21%) 0.020s (± 1.52%) ~ 0.020s 0.021s p=0.640 n=12
Parse Time 0.624s (± 2.60%) 0.604s (± 2.39%) 🟩-0.020s (- 3.14%) 0.568s 0.640s p=0.050 n=12
Bind Time 0.003s (±13.14%) 0.003s (±12.54%) ~ 0.002s 0.003s p=1.000 n=12
Check Time 10.344s (± 0.63%) 9.367s (± 0.38%) 🟩-0.977s (- 9.44%) 9.291s 9.463s p=0.000 n=12
Emit Time 0.510s (± 1.88%) 0.513s (± 1.14%) ~ 0.505s 0.535s p=0.199 n=12
Total Time 12.430s (± 0.51%) 11.545s (± 0.32%) 🟩-0.886s (- 7.12%) 11.449s 11.644s p=0.000 n=12
strada-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,390,229 1,390,229 ~ ~ ~ p=1.000 n=12
Types 441,498 441,498 ~ ~ ~ p=1.000 n=12
Memory Used 1,641,820k (± 0.88%) 1,623,524k (± 0.28%) -18,296k (- 1.11%) 1,612,197k 1,634,391k p=0.028 n=12
Memory Allocs 92,093,413 (± 0.16%) 95,246,262 (± 0.15%) +3,152,849 (+ 3.42%) 94,939,040 95,592,937 p=0.000 n=12
Config Time 0.003s (±14.60%) 0.003s (±14.59%) ~ 0.002s 0.004s p=0.784 n=12
Parse Time 0.191s (± 4.22%) 0.188s (± 2.57%) ~ 0.176s 0.199s p=0.639 n=12
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Check Time 1.820s (± 0.66%) 1.888s (± 0.45%) +0.068s (+ 3.72%) 1.869s 1.908s p=0.000 n=12
Emit Time 0.305s (± 5.01%) 0.321s (± 4.73%) ~ 0.283s 0.372s p=0.173 n=12
Total Time 23.652s (± 0.97%) 24.999s (± 0.56%) 🔻+1.347s (+ 5.70%) 24.737s 25.487s p=0.000 n=12
strada-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 334,953 334,953 ~ ~ ~ p=1.000 n=12
Types 197,616 197,616 ~ ~ ~ p=1.000 n=12
Memory Used 302,588k (± 0.03%) 299,768k (± 0.02%) -2,820k (- 0.93%) 299,594k 299,874k p=0.000 n=12
Memory Allocs 4,622,914 (± 0.01%) 4,830,806 (± 0.01%) 🔻+207,892 (+ 4.50%) 4,830,094 4,831,876 p=0.000 n=12
Config Time 0.001s (±29.38%) 0.001s (±65.70%) ~ 0.000s 0.001s p=0.193 n=12
Parse Time 0.092s (± 5.04%) 0.095s (± 4.82%) ~ 0.083s 0.110s p=0.223 n=12
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Check Time 0.878s (± 0.68%) 0.912s (± 0.42%) +0.034s (+ 3.83%) 0.900s 0.920s p=0.000 n=12
Emit Time 0.109s (±10.35%) 0.124s (± 6.74%) 🔻+0.015s (+13.72%) 0.098s 0.140s p=0.013 n=12
Total Time 1.121s (± 1.06%) 1.201s (± 1.07%) 🔻+0.081s (+ 7.20%) 1.160s 1.235s p=0.000 n=12
ts-pre-modules - native
Errors 87 87 ~ ~ ~ p=1.000 n=12
Symbols 303,834 303,834 ~ ~ ~ p=1.000 n=12
Types 181,663 181,663 ~ ~ ~ p=1.000 n=12
Memory Used 263,493k (± 0.02%) 260,182k (± 0.02%) -3,311k (- 1.26%) 259,924k 260,272k p=0.000 n=12
Memory Allocs 1,616,022 (± 0.01%) 1,791,998 (± 0.01%) 🔻+175,976 (+10.89%) 1,791,727 1,792,462 p=0.000 n=12
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Parse Time 0.099s (± 3.19%) 0.098s (± 4.94%) ~ 0.089s 0.108s p=0.832 n=12
Bind Time 0.037s (± 9.76%) 0.070s (± 7.91%) 🔻+0.034s (+90.97%) 0.058s 0.081s p=0.000 n=12
Check Time 0.829s (± 0.76%) 0.860s (± 0.82%) +0.031s (+ 3.69%) 0.844s 0.878s p=0.000 n=12
Emit Time 0.000s (±217.90%) 0.000s ~ ~ ~ p=1.000 n=12
Total Time 0.981s (± 0.53%) 1.043s (± 0.71%) 🔻+0.062s (+ 6.29%) 1.026s 1.069s p=0.000 n=12
vscode - native
Errors 380 380 ~ ~ ~ p=1.000 n=12
Symbols 11,126,412 11,126,412 ~ ~ ~ p=1.000 n=12
Types 3,695,451 3,695,451 ~ ~ ~ p=1.000 n=12
Memory Used 6,709,468k (± 0.02%) 6,472,806k (± 0.02%) 🟩-236,662k (- 3.53%) 6,468,963k 6,477,601k p=0.000 n=12
Memory Allocs 54,762,461 (± 0.03%) 56,714,048 (± 0.02%) +1,951,587 (+ 3.56%) 56,703,781 56,758,908 p=0.000 n=12
Config Time 0.073s (± 0.56%) 0.074s (± 0.44%) +0.001s (+ 1.48%) 0.074s 0.075s p=0.000 n=12
Parse Time 1.812s (± 3.88%) 1.836s (± 3.66%) ~ 1.672s 2.035s p=0.671 n=12
Bind Time 0.622s (±18.49%) 0.831s (±15.00%) 🔻+0.209s (+33.64%) 0.690s 1.232s p=0.018 n=12
Check Time 13.958s (± 1.17%) 14.712s (± 0.99%) 🔻+0.753s (+ 5.40%) 14.238s 14.937s p=0.000 n=12
Emit Time 4.908s (±12.67%) 4.654s (± 8.71%) ~ 4.184s 6.004s p=0.443 n=12
Total Time 21.463s (± 2.41%) 22.186s (± 1.51%) ~ 21.711s 23.306s p=0.143 n=12
webpack - native
Errors 589 589 ~ ~ ~ p=1.000 n=12
Symbols 1,304,270 1,304,270 ~ ~ ~ p=1.000 n=12
Types 618,461 618,461 ~ ~ ~ p=1.000 n=12
Memory Used 958,988k (± 0.01%) 925,774k (± 0.02%) 🟩-33,214k (- 3.46%) 925,297k 926,313k p=0.000 n=12
Memory Allocs 6,606,657 (± 0.01%) 7,086,476 (± 0.04%) 🔻+479,819 (+ 7.26%) 7,081,900 7,094,237 p=0.000 n=12
Config Time 0.009s 0.009s ~ ~ ~ p=1.000 n=12
Parse Time 0.288s (± 3.23%) 0.291s (± 3.25%) ~ 0.267s 0.319s p=0.744 n=12
Bind Time 0.086s (±20.33%) 0.128s (±10.05%) 🔻+0.042s (+49.03%) 0.107s 0.177s p=0.001 n=12
Check Time 2.073s (± 1.02%) 2.127s (± 0.88%) +0.054s (+ 2.62%) 2.073s 2.162s p=0.001 n=12
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Total Time 2.491s (± 0.52%) 2.591s (± 0.63%) 🔻+0.101s (+ 4.03%) 2.558s 2.639s p=0.000 n=12
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,055,452 1,055,452 ~ ~ ~ p=1.000 n=12
Types 386,738 386,738 ~ ~ ~ p=1.000 n=12
Memory Used 570,764k (± 0.03%) 545,375k (± 0.03%) 🟩-25,389k (- 4.45%) 545,072k 545,991k p=0.000 n=12
Memory Allocs 4,859,932 (± 0.08%) 5,156,372 (± 0.09%) 🔻+296,440 (+ 6.10%) 5,146,655 5,173,137 p=0.000 n=12
Config Time 0.003s (± 6.23%) 0.003s (± 6.23%) ~ 0.002s 0.003s p=1.000 n=12
Parse Time 0.143s (± 2.40%) 0.145s (± 3.12%) ~ 0.131s 0.154s p=0.416 n=12
Bind Time 0.044s (±21.01%) 0.090s (±12.08%) 🔻+0.046s (+104.91%) 0.066s 0.111s p=0.000 n=12
Check Time 1.128s (± 0.48%) 1.130s (± 0.74%) ~ 1.112s 1.164s p=0.660 n=12
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Total Time 1.324s (± 0.56%) 1.374s (± 0.76%) +0.050s (+ 3.78%) 1.344s 1.394s p=0.000 n=12
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • strada-build-src - native
  • strada-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 12
Baseline baseline 12

lsp

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsLSP - native
Req 1 - updateOpen 13ms (±10.94%) 14ms (±10.03%) ~ 11ms 17ms p=0.513 n=12
Req 2 - geterr 699ms (± 0.41%) 709ms (± 0.64%) +9ms (+ 1.33%) 697ms 717ms p=0.002 n=12
Req 3 - references 53ms (± 4.78%) 52ms (± 7.15%) ~ 43ms 62ms p=0.382 n=12
Req 4 - navto 20ms (± 3.00%) 20ms (± 6.07%) ~ 18ms 26ms p=0.383 n=12
Req 5 - completionInfo count 1,363 1,363 ~ ~ ~ p=1.000 n=12
Req 5 - completionInfo 20ms (± 7.01%) 20ms (±11.54%) ~ 16ms 30ms p=0.136 n=12
CompilerLSP - native
Req 1 - updateOpen 12ms (±13.27%) 11ms (±10.67%) ~ 10ms 15ms p=1.000 n=12
Req 2 - geterr 298ms (± 0.64%) 318ms (± 0.60%) 🔻+20ms (+ 6.76%) 313ms 324ms p=0.000 n=12
Req 3 - references 50ms (± 3.62%) 49ms (± 4.22%) ~ 44ms 54ms p=0.678 n=12
Req 4 - navto 17ms (± 3.43%) 17ms (± 2.54%) ~ 15ms 17ms p=0.167 n=12
Req 5 - completionInfo count 1,525 1,525 ~ ~ ~ p=1.000 n=12
Req 5 - completionInfo 17ms (± 6.11%) 17ms (± 6.98%) ~ 15ms 21ms p=0.741 n=12
System info unknown
Hosts
  • native
Scenarios
  • CompilerLSP - native
  • Compiler-UnionsLSP - native
  • xstate-main-1-LSP - native
Benchmark Name Iterations
Current pr 12
Baseline baseline 12

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
lsp-startup - native
Execution time 4.80ms (±365.08%) 4.83ms (±365.09%) +0.03ms (+ 0.62%) 0.00ms 491.10ms p=0.000 n=1200
tsgo-startup - native
Execution time 5.83ms (±365.09%) 5.88ms (±365.08%) +0.04ms (+ 0.73%) 0.00ms 593.40ms p=0.000 n=1200
System info unknown
Hosts
  • native
Scenarios
  • lsp-startup - native
  • tsgo-startup - native
Benchmark Name Iterations
Current pr 12
Baseline baseline 12

Developer Information:

Download Benchmarks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant