Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

Lazily collect source file identifiers - #4731

Merged
Jake Bailey (jakebailey) merged 8 commits into
mainfrom
jabaile/lazy-identifiers
Jul 27, 2026
Merged

Jake Bailey (jakebailey) merged 8 commits into
mainfrom
jabaile/lazy-identifiers

Conversation

@jakebailey

@jakebailey Jake Bailey (jakebailey) commented Jul 24, 2026 •

Copy link
Copy Markdown
Member

We do this eagerly, but only need it in certain emit cases. Defer the work until requested, and then clean up the interning code (which does not appear to help and doesn't help in maps anyway).

goos: linux
goarch: amd64
pkg: github.com/microsoft/typescript-go/internal/parser
cpu: Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
                                                      │   old.txt   │               new.txt               │
                                                      │   sec/op    │   sec/op     vs base                │
Parse/empty.ts-20                                       664.3n ± 7%   627.0n ± 2%   -5.61% (p=0.000 n=10)
Parse/checker.ts-20                                     42.79m ± 2%   37.20m ± 1%  -13.06% (p=0.000 n=10)
Parse/dom.generated.d.ts-20                             16.34m ± 1%   13.95m ± 2%  -14.61% (p=0.000 n=10)
Parse/Herebyfile.mjs-20                                 823.3µ ± 0%   754.3µ ± 0%   -8.38% (p=0.000 n=10)
Parse/jsxComplexSignatureHasApplicabilityError.tsx-20   237.9µ ± 1%   207.6µ ± 0%  -12.73% (p=0.000 n=10)
geomean                                                 619.1µ        551.4µ       -10.94%
                                                      │    old.txt    │               new.txt                │
                                                      │     B/op      │     B/op      vs base                │
Parse/empty.ts-20                                        1.048Ki ± 0%   1.048Ki ± 0%        ~ (p=1.000 n=10)
Parse/checker.ts-20                                      26.43Mi ± 0%   25.22Mi ± 0%   -4.58% (p=0.000 n=10)
Parse/dom.generated.d.ts-20                             11.076Mi ± 0%   9.927Mi ± 0%  -10.37% (p=0.000 n=10)
Parse/Herebyfile.mjs-20                                  462.4Ki ± 0%   425.9Ki ± 0%   -7.89% (p=0.000 n=10)
Parse/jsxComplexSignatureHasApplicabilityError.tsx-20    175.6Ki ± 0%   157.1Ki ± 0%  -10.50% (p=0.000 n=10)
geomean                                                  482.4Ki        449.8Ki        -6.75%
                                                      │   old.txt   │               new.txt                │
                                                      │  allocs/op  │  allocs/op   vs base                 │
Parse/empty.ts-20                                        4.000 ± 0%    4.000 ± 0%       ~ (p=1.000 n=10) ¹
Parse/checker.ts-20                                     12.02k ± 0%   11.94k ± 0%  -0.66% (p=0.000 n=10)
Parse/dom.generated.d.ts-20                             2.864k ± 0%   2.788k ± 0%  -2.65% (p=0.000 n=10)
Parse/Herebyfile.mjs-20                                 1.119k ± 0%   1.104k ± 0%  -1.34% (p=0.000 n=10)
Parse/jsxComplexSignatureHasApplicabilityError.tsx-20    196.0 ± 0%    183.0 ± 0%  -6.63% (p=0.000 n=10)
geomean                                                  496.6         485.2       -2.29%
¹ all samples are equal
Copilot AI review requested due to automatic review settings July 24, 2026 17:24
@jakebailey

Copy link
Copy Markdown
Member Author
@typescript-automation

typescript-automation Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

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

Command Status Results
perf test this ✅ Started 👀 Results

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.

Pull request overview

Defers source-file identifier collection until emit-time uniqueness checks need it and removes parser string interning.

Changes:

  • Lazily scans source text for identifiers and relevant literals.
  • Caches identifier sets safely with sync.Once.
  • Removes eager parser interning and identifier-map population.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
internal/printer/utilities.go Computes identifiers during uniqueness checks.
internal/parser/parser.go Removes eager interning and collection.
internal/parser/jsdoc.go Removes obsolete JSDoc interning.
internal/ast/ast.go Adds lazy identifier-set storage and accessor.
@typescript-automation

Copy link
Copy Markdown

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 4 4 ~ ~ ~ p=1.000 n=6
Symbols 81,803 (± 0.04%) 81,824 (± 0.03%) ~ 81,779 81,852 p=0.230 n=6
Types 98,817 98,817 ~ ~ ~ p=1.000 n=6
Memory Used 177,002k (± 0.49%) 174,528k (± 0.37%) -2,474k (- 1.40%) 173,646k 175,517k p=0.005 n=6
Memory Allocs 2,695,602 (± 0.01%) 2,694,967 (± 0.01%) -635 (- 0.02%) 2,694,549 2,695,169 p=0.005 n=6
Config Time 0.001s (±109.43%) 0.001s (±109.43%) ~ 0.000s 0.001s p=1.000 n=6
Parse Time 0.060s (± 3.58%) 0.057s (± 5.14%) ~ 0.054s 0.061s p=0.073 n=6
Bind Time 0.019s (±15.21%) 0.018s (± 6.08%) ~ 0.017s 0.020s p=0.317 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.977s (± 2.34%) 0.974s (± 0.97%) ~ 0.959s 0.985s p=1.000 n=6
Total Time 1.058s (± 2.07%) 1.050s (± 0.90%) ~ 1.034s 1.059s p=0.470 n=6
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 871,876 (± 0.17%) 871,897 (± 0.11%) ~ 870,727 873,441 p=0.471 n=6
Types 263,961 (± 0.00%) 263,962 (± 0.00%) ~ 263,960 263,964 p=0.437 n=6
Memory Used 828,486k (± 0.09%) 817,071k (± 0.09%) -11,414k (- 1.38%) 815,902k 818,271k p=0.005 n=6
Memory Allocs 13,187,536 (± 0.13%) 13,158,718 (± 0.08%) -28,818 (- 0.22%) 13,148,580 13,175,765 p=0.020 n=6
Config Time 0.027s (±17.84%) 0.025s (± 8.21%) ~ 0.022s 0.027s p=0.459 n=6
Parse Time 0.267s (± 2.75%) 0.259s (± 5.61%) ~ 0.238s 0.274s p=0.335 n=6
Bind Time 0.044s (± 6.98%) 0.053s (±25.80%) ~ 0.041s 0.077s p=0.293 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 2.115s (± 2.00%) 2.108s (± 1.26%) ~ 2.074s 2.140s p=0.936 n=6
Total Time 2.466s (± 1.96%) 2.462s (± 0.89%) ~ 2.424s 2.483s p=0.810 n=6
mui-docs - native
Errors 11,280 (± 0.03%) 11,279 (± 0.04%) ~ 11,271 11,282 p=0.655 n=6
Symbols 4,448,802 4,448,802 ~ ~ ~ p=1.000 n=6
Types 1,659,690 1,659,690 ~ ~ ~ p=1.000 n=6
Memory Used 5,072,405k (± 0.03%) 5,053,605k (± 0.03%) -18,800k (- 0.37%) 5,052,177k 5,055,621k p=0.005 n=6
Memory Allocs 51,284,850 (± 0.05%) 51,197,365 (± 0.05%) -87,485 (- 0.17%) 51,156,501 51,221,463 p=0.005 n=6
Config Time 0.026s (± 9.46%) 0.028s (±15.26%) ~ 0.020s 0.031s p=0.331 n=6
Parse Time 0.576s (± 1.80%) 0.565s (± 2.92%) ~ 0.536s 0.584s p=0.230 n=6
Bind Time 0.003s 0.002s (±22.11%) 🟩-0.001s (-22.22%) 0.002s 0.003s p=0.025 n=6
Check Time 19.803s (± 0.44%) 19.599s (± 0.69%) -0.205s (- 1.03%) 19.467s 19.842s p=0.031 n=6
Emit Time 0.666s (±23.32%) 0.552s (± 4.20%) ~ 0.534s 0.592s p=0.065 n=6
Total Time 21.974s (± 0.59%) 21.579s (± 0.87%) -0.395s (- 1.80%) 21.398s 21.853s p=0.008 n=6
self-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,394,220 1,394,220 ~ ~ ~ p=1.000 n=6
Types 442,210 442,210 ~ ~ ~ p=1.000 n=6
Memory Used 1,663,352k (± 0.44%) 1,633,552k (± 0.36%) -29,800k (- 1.79%) 1,623,283k 1,640,743k p=0.005 n=6
Memory Allocs 97,283,035 (± 0.07%) 97,148,351 (± 0.06%) -134,684 (- 0.14%) 97,083,585 97,222,128 p=0.013 n=6
Config Time 0.022s (±22.49%) 0.024s (± 7.86%) ~ 0.020s 0.025s p=0.572 n=6
Parse Time 0.259s (± 1.50%) 0.241s (± 4.03%) 🟩-0.018s (- 6.82%) 0.228s 0.253s p=0.005 n=6
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Check Time 2.548s (± 0.82%) 2.528s (± 0.84%) ~ 2.508s 2.569s p=0.128 n=6
Emit Time 0.351s (± 5.08%) 0.352s (± 6.08%) ~ 0.324s 0.384s p=0.936 n=6
Total Time 32.920s (± 0.84%) 32.573s (± 1.05%) ~ 32.137s 32.973s p=0.093 n=6
self-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 337,681 337,681 ~ ~ ~ p=1.000 n=6
Types 199,559 199,559 ~ ~ ~ p=1.000 n=6
Memory Used 326,464k (± 0.04%) 322,634k (± 0.02%) -3,830k (- 1.17%) 322,556k 322,758k p=0.005 n=6
Memory Allocs 4,684,758 (± 0.01%) 4,678,134 (± 0.02%) -6,623 (- 0.14%) 4,676,959 4,679,304 p=0.005 n=6
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Parse Time 0.131s (± 4.56%) 0.120s (± 7.45%) ~ 0.112s 0.136s p=0.106 n=6
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Check Time 1.280s (± 0.87%) 1.274s (± 0.75%) ~ 1.261s 1.289s p=0.423 n=6
Emit Time 0.117s (± 7.35%) 0.114s (± 8.29%) ~ 0.105s 0.129s p=0.575 n=6
Total Time 1.584s (± 0.63%) 1.560s (± 0.90%) -0.024s (- 1.54%) 1.547s 1.586s p=0.031 n=6
ts-pre-modules - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 97,488 97,488 ~ ~ ~ p=1.000 n=6
Types 356 356 ~ ~ ~ p=1.000 n=6
Memory Used 133,549k (± 0.01%) 130,158k (± 0.01%) -3,391k (- 2.54%) 130,148k 130,173k p=0.005 n=6
Memory Allocs 180,188 (± 0.18%) 178,098 (± 0.26%) -2,091 (- 1.16%) 177,399 178,784 p=0.005 n=6
Config Time 0.000s (±244.70%) 0.000s (±244.70%) ~ 0.000s 0.001s p=1.000 n=6
Parse Time 0.111s (± 7.63%) 0.108s (± 2.71%) ~ 0.104s 0.112s p=0.416 n=6
Bind Time 0.037s (± 4.15%) 0.033s (±12.82%) ~ 0.029s 0.037s p=0.249 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Total Time 0.150s (± 6.09%) 0.143s (± 5.04%) ~ 0.135s 0.152s p=0.296 n=6
vscode - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 7,308,559 7,308,559 ~ ~ ~ p=1.000 n=6
Types 2,560,866 2,560,866 ~ ~ ~ p=1.000 n=6
Memory Used 5,013,618k (± 0.02%) 4,955,002k (± 0.01%) -58,617k (- 1.17%) 4,954,180k 4,956,017k p=0.005 n=6
Memory Allocs 37,711,159 (± 0.13%) 37,610,446 (± 0.10%) -100,712 (- 0.27%) 37,579,707 37,683,289 p=0.013 n=6
Config Time 0.078s (± 8.28%) 0.076s (± 7.16%) ~ 0.071s 0.083s p=0.624 n=6
Parse Time 0.967s (± 5.91%) 0.918s (± 4.19%) ~ 0.851s 0.963s p=0.173 n=6
Bind Time 0.193s (±27.82%) 0.195s (±38.57%) ~ 0.155s 0.347s p=0.630 n=6
Check Time 8.498s (± 1.09%) 8.488s (± 1.09%) ~ 8.393s 8.602s p=0.936 n=6
Emit Time 2.324s (± 8.98%) 2.286s (± 8.36%) ~ 2.029s 2.554s p=0.689 n=6
Total Time 12.084s (± 0.86%) 11.981s (± 0.67%) ~ 11.921s 12.108s p=0.066 n=6
webpack - native
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 193,220 193,220 ~ ~ ~ p=1.000 n=6
Types 340 340 ~ ~ ~ p=1.000 n=6
Memory Used 238,284k (± 0.12%) 232,547k (± 0.14%) -5,737k (- 2.41%) 232,205k 233,001k p=0.005 n=6
Memory Allocs 983,819 (± 0.39%) 972,912 (± 0.32%) -10,907 (- 1.11%) 968,091 977,057 p=0.005 n=6
Config Time 0.012s (±21.71%) 0.011s (±16.40%) ~ 0.008s 0.012s p=0.288 n=6
Parse Time 0.157s (± 7.58%) 0.152s (± 5.68%) ~ 0.142s 0.162s p=0.470 n=6
Bind Time 0s 0s ~ ~ ~ p=1.000 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.048s (±19.06%) 0.044s (±16.41%) ~ 0.038s 0.056s p=0.470 n=6
Total Time 0.218s (± 4.94%) 0.207s (± 4.32%) ~ 0.193s 0.218s p=0.173 n=6
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,064,618 1,064,618 ~ ~ ~ p=1.000 n=6
Types 392,776 392,776 ~ ~ ~ p=1.000 n=6
Memory Used 649,082k (± 0.02%) 642,678k (± 0.03%) -6,405k (- 0.99%) 642,451k 642,978k p=0.005 n=6
Memory Allocs 5,004,303 (± 0.11%) 4,991,997 (± 0.04%) -12,306 (- 0.25%) 4,988,793 4,994,500 p=0.005 n=6
Config Time 0.005s (±17.48%) 0.005s (± 8.44%) ~ 0.004s 0.005s p=1.000 n=6
Parse Time 0.138s (± 6.88%) 0.129s (± 6.36%) ~ 0.122s 0.144s p=0.170 n=6
Bind Time 0.036s (±28.34%) 0.033s (±22.81%) ~ 0.026s 0.043s p=0.575 n=6
Check Time 1.231s (± 0.98%) 1.239s (± 1.16%) ~ 1.225s 1.260s p=0.468 n=6
Emit Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Total Time 1.414s (± 1.01%) 1.410s (± 1.14%) ~ 1.392s 1.436s p=0.630 n=6
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • self-build-src - native
  • self-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

lsp

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsLSP - native
Req 1 - updateOpen 11ms (± 7.65%) 10ms (± 9.98%) ~ 9ms 12ms p=0.546 n=6
Req 2 - geterr 893ms (± 0.15%) 889ms (± 0.99%) ~ 882ms 906ms p=0.064 n=6
Req 3 - references 43ms (±11.57%) 43ms (± 8.07%) ~ 39ms 47ms p=1.000 n=6
Req 4 - navto 17ms (± 3.72%) 17ms (± 3.72%) ~ 16ms 18ms p=1.000 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 16ms (±19.01%) 16ms (±17.42%) ~ 13ms 21ms p=0.864 n=6
CompilerLSP - native
Req 1 - updateOpen 11ms (± 6.94%) 11ms (± 3.76%) ~ 10ms 11ms p=1.000 n=6
Req 2 - geterr 444ms (± 1.17%) 440ms (± 3.74%) ~ 426ms 469ms p=0.296 n=6
Req 3 - references 47ms (± 2.56%) 48ms (± 6.92%) ~ 43ms 52ms p=0.506 n=6
Req 4 - navto 18ms (± 2.24%) 18ms (± 5.51%) ~ 17ms 19ms p=0.487 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 23ms (±24.60%) 20ms (±21.18%) ~ 14ms 25ms p=0.464 n=6
System info unknown
Hosts
  • native
Scenarios
  • CompilerLSP - native
  • Compiler-UnionsLSP - native
  • xstate-main-1-LSP - native
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
lsp-startup - native
Execution time 4.75ms (±516.54%) 4.76ms (±516.54%) +0.01ms (+ 0.22%) 0.00ms 479.69ms p=0.000 n=600
tsgo-startup - native
Execution time 6.01ms (±516.62%) 6.04ms (±516.61%) +0.04ms (+ 0.58%) 0.00ms 611.50ms p=0.000 n=600
System info unknown
Hosts
  • native
Scenarios
  • lsp-startup - native
  • tsgo-startup - native
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

Comment thread internal/printer/utilities.go Outdated
}
_, ok := sourceFile.Identifiers[name]
return !ok
identifiers := sourceFile.GetIdentifiers(func(sourceFile *ast.SourceFile) collections.Set[string] {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not a mega fan of this pattern, might change to be more like JSDoc lazy

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Though this is not dissimilar to Bind, theoretically

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we'd actually end up needing a walk of the tree for these.

Comment thread internal/printer/utilities.go Resolved
@DanielRosenwasser

Copy link
Copy Markdown
Member
@typescript-automation

typescript-automation Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

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

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 4 4 ~ ~ ~ p=1.000 n=6
Symbols 81,806 (± 0.02%) 81,816 (± 0.01%) ~ 81,804 81,837 p=0.467 n=6
Types 98,817 98,817 ~ ~ ~ p=1.000 n=6
Memory Used 175,704k (± 0.63%) 174,156k (± 0.52%) -1,548k (- 0.88%) 172,972k 175,356k p=0.045 n=6
Memory Allocs 2,695,554 (± 0.01%) 2,694,907 (± 0.01%) -647 (- 0.02%) 2,694,636 2,695,184 p=0.008 n=6
Config Time 0.000s (±244.70%) 0.001s (±109.43%) ~ 0.000s 0.001s p=0.282 n=6
Parse Time 0.061s (± 5.03%) 0.057s (± 5.54%) ~ 0.053s 0.062s p=0.077 n=6
Bind Time 0.019s (±18.96%) 0.022s (±19.42%) ~ 0.014s 0.025s p=0.168 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.991s (± 1.85%) 0.975s (± 2.16%) ~ 0.950s 1.001s p=0.128 n=6
Total Time 1.074s (± 1.57%) 1.057s (± 1.94%) ~ 1.033s 1.086s p=0.230 n=6
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 872,193 (± 0.20%) 871,405 (± 0.20%) ~ 868,957 873,315 p=0.471 n=6
Types 263,962 (± 0.00%) 263,962 (± 0.00%) ~ 263,960 263,964 p=0.607 n=6
Memory Used 828,742k (± 0.08%) 817,332k (± 0.07%) -11,410k (- 1.38%) 816,757k 818,362k p=0.005 n=6
Memory Allocs 13,182,235 (± 0.10%) 13,149,968 (± 0.06%) -32,268 (- 0.24%) 13,142,210 13,162,251 p=0.005 n=6
Config Time 0.024s (± 3.72%) 0.028s (±14.25%) ~ 0.021s 0.032s p=0.064 n=6
Parse Time 0.267s (± 2.47%) 0.248s (± 3.63%) 🟩-0.019s (- 7.17%) 0.236s 0.261s p=0.010 n=6
Bind Time 0.051s (±38.05%) 0.058s (±32.36%) ~ 0.043s 0.083s p=0.336 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 2.126s (± 1.32%) 2.082s (± 1.66%) -0.044s (- 2.08%) 2.025s 2.126s p=0.037 n=6
Total Time 2.481s (± 0.94%) 2.428s (± 1.26%) -0.053s (- 2.12%) 2.385s 2.458s p=0.025 n=6
mui-docs - native
Errors 11,278 (± 0.05%) 11,280 (± 0.02%) ~ 11,278 11,282 p=0.934 n=6
Symbols 4,448,802 4,448,802 ~ ~ ~ p=1.000 n=6
Types 1,659,690 1,659,690 ~ ~ ~ p=1.000 n=6
Memory Used 5,072,276k (± 0.02%) 5,053,420k (± 0.02%) -18,856k (- 0.37%) 5,051,997k 5,054,891k p=0.005 n=6
Memory Allocs 51,253,498 (± 0.07%) 51,196,723 (± 0.07%) -56,775 (- 0.11%) 51,141,848 51,244,814 p=0.020 n=6
Config Time 0.025s (±14.94%) 0.025s (±15.22%) ~ 0.021s 0.031s p=0.936 n=6
Parse Time 0.579s (± 1.77%) 0.557s (± 3.60%) ~ 0.537s 0.584s p=0.093 n=6
Bind Time 0.002s (±22.11%) 0.003s (±21.89%) ~ 0.002s 0.003s p=0.640 n=6
Check Time 19.607s (± 0.69%) 19.546s (± 0.91%) ~ 19.358s 19.752s p=0.689 n=6
Emit Time 0.585s (±22.28%) 0.535s (± 0.36%) ~ 0.532s 0.537s p=0.376 n=6
Total Time 21.632s (± 1.11%) 21.503s (± 1.05%) ~ 21.280s 21.787s p=0.378 n=6
self-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,394,220 1,394,220 ~ ~ ~ p=1.000 n=6
Types 442,210 442,210 ~ ~ ~ p=1.000 n=6
Memory Used 1,666,318k (± 0.28%) 1,629,515k (± 0.32%) -36,803k (- 2.21%) 1,624,983k 1,639,917k p=0.005 n=6
Memory Allocs 97,305,124 (± 0.05%) 97,136,857 (± 0.06%) -168,268 (- 0.17%) 97,073,092 97,217,350 p=0.005 n=6
Config Time 0.023s (±11.38%) 0.026s (± 9.10%) ~ 0.023s 0.028s p=0.173 n=6
Parse Time 0.260s (± 2.21%) 0.240s (± 2.30%) 🟩-0.021s (- 8.00%) 0.233s 0.245s p=0.005 n=6
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Check Time 2.541s (± 0.42%) 2.533s (± 0.66%) ~ 2.514s 2.557s p=0.470 n=6
Emit Time 0.343s (± 3.50%) 0.346s (± 4.05%) ~ 0.327s 0.369s p=0.748 n=6
Total Time 32.794s (± 0.94%) 32.565s (± 0.84%) ~ 32.224s 33.004s p=0.230 n=6
self-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 337,681 337,681 ~ ~ ~ p=1.000 n=6
Types 199,559 199,559 ~ ~ ~ p=1.000 n=6
Memory Used 326,494k (± 0.06%) 322,530k (± 0.03%) -3,964k (- 1.21%) 322,443k 322,680k p=0.005 n=6
Memory Allocs 4,685,862 (± 0.01%) 4,678,043 (± 0.01%) -7,818 (- 0.17%) 4,677,217 4,678,714 p=0.005 n=6
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Parse Time 0.127s (± 4.44%) 0.116s (± 4.00%) 🟩-0.011s (- 8.80%) 0.109s 0.122s p=0.010 n=6
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Check Time 1.286s (± 0.70%) 1.289s (± 0.84%) ~ 1.281s 1.310s p=0.810 n=6
Emit Time 0.112s (± 9.26%) 0.115s (±10.46%) ~ 0.102s 0.133s p=0.809 n=6
Total Time 1.582s (± 1.32%) 1.578s (± 0.78%) ~ 1.557s 1.593s p=0.936 n=6
ts-pre-modules - native
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 97,488 97,488 ~ ~ ~ p=1.000 n=6
Types 356 356 ~ ~ ~ p=1.000 n=6
Memory Used 133,720k (± 0.00%) 130,346k (± 0.02%) -3,373k (- 2.52%) 130,311k 130,387k p=0.005 n=6
Memory Allocs 180,296 (± 0.22%) 178,422 (± 0.21%) -1,874 (- 1.04%) 177,811 178,715 p=0.005 n=6
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Parse Time 0.114s (± 2.68%) 0.105s (± 6.90%) ~ 0.099s 0.117s p=0.091 n=6
Bind Time 0.040s (±11.26%) 0.040s (±17.33%) ~ 0.031s 0.051s p=0.936 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=6
Total Time 0.159s (± 2.42%) 0.149s (± 5.48%) 🟩-0.010s (- 5.99%) 0.136s 0.157s p=0.030 n=6
vscode - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 7,319,469 7,319,469 ~ ~ ~ p=1.000 n=6
Types 2,560,746 2,560,746 ~ ~ ~ p=1.000 n=6
Memory Used 5,015,539k (± 0.03%) 4,967,312k (± 0.04%) -48,227k (- 0.96%) 4,965,071k 4,971,026k p=0.005 n=6
Memory Allocs 37,721,173 (± 0.05%) 37,639,792 (± 0.05%) -81,381 (- 0.22%) 37,618,037 37,661,810 p=0.005 n=6
Config Time 0.075s (± 6.08%) 0.081s (± 8.02%) ~ 0.073s 0.088s p=0.199 n=6
Parse Time 0.982s (± 1.08%) 0.907s (± 3.34%) 🟩-0.075s (- 7.69%) 0.869s 0.954s p=0.005 n=6
Bind Time 0.182s (±23.41%) 0.188s (±34.25%) ~ 0.160s 0.319s p=0.506 n=6
Check Time 8.895s (± 0.83%) 8.915s (± 0.58%) ~ 8.869s 9.005s p=0.575 n=6
Emit Time 2.601s (± 8.84%) 2.546s (± 6.72%) ~ 2.224s 2.703s p=0.378 n=6
Total Time 12.755s (± 1.06%) 12.654s (± 0.81%) ~ 12.528s 12.768s p=0.230 n=6
webpack - native
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 193,220 193,220 ~ ~ ~ p=1.000 n=6
Types 340 340 ~ ~ ~ p=1.000 n=6
Memory Used 237,792k (± 0.10%) 232,359k (± 0.13%) -5,433k (- 2.28%) 231,969k 232,753k p=0.005 n=6
Memory Allocs 980,408 (± 0.20%) 971,141 (± 0.29%) -9,267 (- 0.95%) 967,985 975,901 p=0.005 n=6
Config Time 0.009s (±23.21%) 0.008s (±29.37%) ~ 0.006s 0.011s p=1.000 n=6
Parse Time 0.145s (± 6.05%) 0.138s (± 5.28%) ~ 0.125s 0.145s p=0.226 n=6
Bind Time 0s 0s ~ ~ ~ p=1.000 n=6
Check Time 0s 0s ~ ~ ~ p=1.000 n=6
Emit Time 0.039s (±24.40%) 0.043s (±20.10%) ~ 0.034s 0.054s p=0.470 n=6
Total Time 0.194s (± 3.95%) 0.189s (± 3.83%) ~ 0.182s 0.200s p=0.423 n=6
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,064,618 1,064,618 ~ ~ ~ p=1.000 n=6
Types 392,776 392,776 ~ ~ ~ p=1.000 n=6
Memory Used 649,082k (± 0.02%) 642,642k (± 0.02%) -6,440k (- 0.99%) 642,443k 642,778k p=0.005 n=6
Memory Allocs 5,003,072 (± 0.13%) 4,992,488 (± 0.07%) -10,584 (- 0.21%) 4,988,728 4,998,278 p=0.008 n=6
Config Time 0.005s 0.005s ~ ~ ~ p=1.000 n=6
Parse Time 0.137s (± 4.82%) 0.131s (± 2.41%) ~ 0.126s 0.135s p=0.092 n=6
Bind Time 0.030s (±15.77%) 0.035s (±28.83%) ~ 0.025s 0.048s p=0.469 n=6
Check Time 1.239s (± 1.32%) 1.251s (± 0.81%) ~ 1.234s 1.263s p=0.199 n=6
Emit Time 0.001s 0.001s ~ ~ ~ p=1.000 n=6
Total Time 1.417s (± 0.68%) 1.427s (± 0.60%) ~ 1.417s 1.435s p=0.065 n=6
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • self-build-src - native
  • self-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

lsp

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsLSP - native
Req 1 - updateOpen 10ms (± 4.15%) 10ms (± 6.32%) ~ 9ms 11ms p=0.673 n=6
Req 2 - geterr 902ms (± 1.10%) 877ms (± 0.79%) -25ms (- 2.74%) 869ms 887ms p=0.005 n=6
Req 3 - references 39ms (± 4.57%) 43ms (±11.19%) 🔻+5ms (+11.69%) 39ms 50ms p=0.022 n=6
Req 4 - navto 18ms (±15.03%) 17ms (± 2.42%) ~ 16ms 17ms p=1.000 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 16ms (± 6.76%) 14ms (±27.05%) ~ 12ms 22ms p=0.087 n=6
CompilerLSP - native
Req 1 - updateOpen 11ms (± 8.80%) 11ms (± 3.65%) ~ 11ms 12ms p=0.930 n=6
Req 2 - geterr 443ms (± 1.87%) 430ms (± 1.91%) -13ms (- 2.86%) 421ms 443ms p=0.030 n=6
Req 3 - references 47ms (± 4.25%) 48ms (± 5.27%) ~ 43ms 50ms p=0.094 n=6
Req 4 - navto 18ms (± 2.92%) 18ms (± 5.41%) ~ 17ms 20ms p=0.386 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 21ms (± 4.99%) 22ms (±22.75%) ~ 17ms 32ms p=0.565 n=6
System info unknown
Hosts
  • native
Scenarios
  • CompilerLSP - native
  • Compiler-UnionsLSP - native
  • xstate-main-1-LSP - native
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
lsp-startup - native
Execution time 4.76ms (±516.54%) 4.76ms (±516.55%) +0.01ms (+ 0.11%) 0.00ms 481.47ms p=0.000 n=600
tsgo-startup - native
Execution time 5.93ms (±516.54%) 5.93ms (±516.55%) -0.01ms (- 0.15%) 0.00ms 597.02ms p=0.000 n=600
System info unknown
Hosts
  • native
Scenarios
  • lsp-startup - native
  • tsgo-startup - native
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

Comment thread internal/parser/parser.go Resolved
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit 2b0fe1c Jul 27, 2026
21 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the jabaile/lazy-identifiers branch July 27, 2026 20:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants