Skip to content

Optimize path mapping lookups - #59048

Merged
Daniel Rosenwasser (DanielRosenwasser) merged 14 commits into
mainfrom
binarySearchAndSetsForPatterns
Aug 29, 2024
Merged

Optimize path mapping lookups#59048
Daniel Rosenwasser (DanielRosenwasser) merged 14 commits into
mainfrom
binarySearchAndSetsForPatterns

Conversation

@DanielRosenwasser

@DanielRosenwasserDaniel Rosenwasser (DanielRosenwasser) commented Jun 27, 2024

Copy link
Copy Markdown
Member

When checking if a specifier satisfies a pattern (e.g. for a path mapping entry in paths), it seems like TypeScript needs to check every single available pattern to see if the specifier is matched.

Here, I've slightly modified the code to create a Set of exact specifiers, and an array of all remaining Patterns. The Set becomes a fast look-up, and the fallback becomes a walk across the array. A new difference is that once we've found a match, we don't bother checking any other patterns unless they have a longer prefix than the current match. That can help quickly dismiss irrelevant matches.

This also adds a caches so that we don't end up re-creating these objects over and over.

In earlier iterations of this PR, the array of patterns was sorted and lookups on patterns could optimistically be done via a binary search; however, there's some nuance there with respect to how paths differs from exports, and we don't have enough test coverage there (nothing fails if you only sort by prefix specifier length!). So for now, I've stuck with a linear search.

…uickly.
This also adds a naive cache for each call, though it is not resilient to being passed the same array of patterns twice with different contents, and could be defeated if the patterns frequently differ.
@DanielRosenwasser

Copy link
Copy Markdown
MemberAuthor

I don't know if our perf suites have repos with lots of path mappings, but...

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this✅ Started👀 Results

@DanielRosenwasserDaniel Rosenwasser (DanielRosenwasser) changed the title Use a Set and a binary search to find longest-prefix matches more quicklyUse a Set and a binary search to search for patterns on pathsJun 27, 2024
@DanielRosenwasser

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
pack this✅ Started✅ Results

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

Hey Daniel Rosenwasser (@DanielRosenwasser), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/162456/artifacts?artifactName=tgz&fileId=E2F93981315A9DC4E4D25A7C90DF0240EEFB23C524E61C1D39685D480869765C02&fileName=/typescript-5.6.0-insiders.20240627.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.6.0-pr-59048-4".;

@typescript-bot

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
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15362,153~~~p=1.000 n=6
Types50,24250,242~~~p=1.000 n=6
Memory used192,759k (± 0.76%)192,730k (± 0.74%)~192,087k195,648kp=0.575 n=6
Parse Time1.97s (± 0.52%)1.96s (± 0.53%)~1.95s1.98sp=0.134 n=6
Bind Time1.05s (± 1.11%)1.06s (± 1.19%)~1.04s1.07sp=0.281 n=6
Check Time13.80s (± 0.47%)13.87s (± 0.46%)~13.76s13.94sp=0.092 n=6
Emit Time4.04s (± 0.88%)4.03s (± 0.35%)~4.01s4.05sp=0.375 n=6
Total Time20.86s (± 0.41%)20.92s (± 0.28%)~20.81s20.97sp=0.422 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,114944,114~~~p=1.000 n=6
Types407,050407,050~~~p=1.000 n=6
Memory used1,218,376k (± 0.00%)1,218,327k (± 0.00%)-49k (- 0.00%)1,218,299k1,218,372kp=0.037 n=6
Parse Time6.67s (± 0.92%)6.69s (± 0.35%)~6.66s6.72sp=0.747 n=6
Bind Time1.86s (± 0.22%)1.88s (± 1.19%)~1.86s1.92sp=0.073 n=6
Check Time30.63s (± 0.35%)30.60s (± 0.24%)~30.47s30.67sp=0.630 n=6
Emit Time13.62s (± 0.19%)13.56s (± 0.27%)-0.05s (- 0.40%)13.50s13.61sp=0.016 n=6
Total Time52.78s (± 0.22%)52.73s (± 0.16%)~52.61s52.84sp=0.335 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,132,3862,132,386~~~p=1.000 n=6
Types926,170926,170~~~p=1.000 n=6
Memory used2,114,898k (± 0.01%)2,114,937k (± 0.01%)~2,114,683k2,115,049kp=0.630 n=6
Parse Time7.89s (± 0.47%)7.89s (± 0.19%)~7.88s7.91sp=1.000 n=6
Bind Time2.74s (± 0.64%)2.74s (± 0.46%)~2.73s2.76sp=0.731 n=6
Check Time83.69s (± 0.49%)83.47s (± 0.39%)~83.18s83.92sp=0.575 n=6
Emit Time0.16s (± 4.99%)0.16s (± 5.58%)~0.15s0.17sp=0.550 n=6
Total Time94.49s (± 0.40%)94.27s (± 0.35%)~93.95s94.71sp=0.378 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,231,6401,231,673+33 (+ 0.00%)~~p=0.001 n=6
Types261,187261,192+5 (+ 0.00%)~~p=0.001 n=6
Memory used2,348,423k (± 0.05%)2,348,122k (± 0.04%)~2,347,054k2,349,167kp=0.689 n=6
Parse Time6.00s (± 0.93%)5.99s (± 0.87%)~5.91s6.04sp=0.748 n=6
Bind Time2.27s (± 0.51%)2.28s (± 1.09%)~2.26s2.33sp=0.244 n=6
Check Time40.13s (± 0.28%)40.08s (± 0.34%)~39.89s40.22sp=0.810 n=6
Emit Time3.21s (± 2.66%)3.21s (± 2.41%)~3.11s3.34sp=0.936 n=6
Total Time51.63s (± 0.19%)51.58s (± 0.23%)~51.41s51.74sp=0.470 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,231,6401,231,673+33 (+ 0.00%)~~p=0.001 n=6
Types261,187261,192+5 (+ 0.00%)~~p=0.001 n=6
Memory used2,424,816k (± 0.05%)2,424,237k (± 0.03%)~2,423,155k2,425,368kp=0.689 n=6
Parse Time6.22s (± 0.38%)6.26s (± 1.00%)~6.19s6.37sp=0.261 n=6
Bind Time2.05s (± 0.91%)2.06s (± 1.14%)~2.03s2.09sp=1.000 n=6
Check Time40.56s (± 0.11%)40.52s (± 0.34%)~40.33s40.75sp=0.336 n=6
Emit Time3.22s (± 2.09%)3.20s (± 3.83%)~3.10s3.42sp=0.378 n=6
Total Time52.06s (± 0.15%)52.05s (± 0.15%)~51.95s52.18sp=1.000 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,818258,840+22 (+ 0.01%)~~p=0.001 n=6
Types104,842104,847+5 (+ 0.00%)~~p=0.001 n=6
Memory used428,229k (± 0.01%)428,298k (± 0.01%)+69k (+ 0.02%)428,256k428,345kp=0.020 n=6
Parse Time3.34s (± 0.57%)3.31s (± 0.89%)~3.26s3.34sp=0.167 n=6
Bind Time1.30s (± 1.84%)1.32s (± 1.56%)~1.29s1.34sp=0.120 n=6
Check Time17.80s (± 0.39%)17.73s (± 0.39%)~17.65s17.81sp=0.227 n=6
Emit Time1.37s (± 1.07%)1.37s (± 0.55%)~1.36s1.38sp=0.934 n=6
Total Time23.82s (± 0.21%)23.73s (± 0.36%)~23.61s23.85sp=0.092 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,565224,565~~~p=1.000 n=6
Types93,73493,734~~~p=1.000 n=6
Memory used369,533k (± 0.03%)369,460k (± 0.01%)~369,392k369,550kp=0.378 n=6
Parse Time2.77s (± 1.28%)2.76s (± 0.70%)~2.73s2.78sp=1.000 n=6
Bind Time1.59s (± 0.65%)1.60s (± 1.28%)~1.58s1.62sp=0.511 n=6
Check Time15.49s (± 0.19%)15.52s (± 0.32%)~15.44s15.58sp=0.294 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time19.84s (± 0.27%)19.88s (± 0.31%)~19.77s19.94sp=0.296 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,878,5792,878,579~~~p=1.000 n=6
Types975,166975,166~~~p=1.000 n=6
Memory used3,042,072k (± 0.00%)3,042,036k (± 0.00%)~3,041,971k3,042,083kp=0.575 n=6
Parse Time13.54s (± 0.39%)13.55s (± 0.46%)~13.47s13.62sp=0.810 n=6
Bind Time4.19s (± 0.18%)4.19s (± 0.36%)~4.18s4.22sp=0.503 n=6
Check Time73.36s (± 0.40%)73.42s (± 0.26%)~73.19s73.66sp=0.575 n=6
Emit Time23.91s (± 1.68%)24.17s (± 0.94%)~23.94s24.55sp=0.128 n=6
Total Time115.00s (± 0.32%)115.32s (± 0.31%)~114.92s115.94sp=0.128 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols267,117267,117~~~p=1.000 n=6
Types108,775108,775~~~p=1.000 n=6
Memory used411,649k (± 0.01%)411,579k (± 0.02%)~411,443k411,669kp=0.173 n=6
Parse Time4.74s (± 0.56%)4.70s (± 0.49%)-0.04s (- 0.77%)4.67s4.74sp=0.035 n=6
Bind Time2.09s (± 0.68%)2.08s (± 1.11%)~2.05s2.10sp=0.514 n=6
Check Time20.78s (± 0.37%)20.79s (± 0.54%)~20.67s20.98sp=0.747 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.61s (± 0.31%)27.56s (± 0.41%)~27.46s27.76sp=0.470 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols525,251525,251~~~p=1.000 n=6
Types178,574178,574~~~p=1.000 n=6
Memory used463,064k (± 0.08%)462,963k (± 0.06%)~462,426k463,213kp=0.173 n=6
Parse Time2.65s (± 0.51%)2.65s (± 0.50%)~2.63s2.67sp=0.801 n=6
Bind Time0.98s (± 0.56%)0.98s~~~p=0.071 n=6
Check Time15.21s (± 0.48%)15.17s (± 0.44%)~15.10s15.25sp=0.470 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.85s (± 0.39%)18.81s (± 0.33%)~18.73s18.87sp=0.571 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,274ms (± 1.44%)2,300ms (± 0.75%)~2,272ms2,314msp=0.109 n=6
Req 2 - geterr5,071ms (± 0.48%)5,069ms (± 0.54%)~5,042ms5,109msp=0.810 n=6
Req 3 - references264ms (± 0.29%)263ms (± 0.44%)~262ms265msp=0.279 n=6
Req 4 - navto226ms (± 1.33%)228ms (± 0.18%)~228ms229msp=0.390 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo88ms (± 6.70%)83ms (± 7.76%)~77ms90msp=0.157 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,417ms (± 0.54%)2,428ms (± 1.26%)~2,377ms2,456msp=0.297 n=6
Req 2 - geterr3,792ms (± 0.16%)3,798ms (± 0.26%)~3,786ms3,809msp=0.297 n=6
Req 3 - references278ms (± 0.30%)278ms (± 0.29%)~277ms279msp=0.718 n=6
Req 4 - navto226ms (± 0.52%)226ms (± 0.37%)~225ms227msp=0.652 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo75ms (± 6.28%)73ms (± 0.56%)~73ms74msp=0.445 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen6,217ms (± 0.67%)6,220ms (± 0.28%)~6,200ms6,242msp=0.689 n=6
Req 2 - geterr1,532ms (±11.81%)1,698ms (± 0.84%)~1,682ms1,715msp=0.173 n=6
Req 3 - references109ms (± 9.33%)113ms (± 3.81%)~111ms122msp=0.171 n=6
Req 4 - navto576ms (± 6.04%)587ms (± 2.41%)~574ms611msp=0.936 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo1,250ms (± 2.22%)1,238ms (± 2.07%)~1,212ms1,287msp=0.173 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time156.84ms (± 0.17%)156.94ms (± 0.17%)+0.10ms (+ 0.06%)155.80ms160.68msp=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time283.97ms (± 0.28%)284.00ms (± 0.29%)~276.60ms291.87msp=0.420 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time227.89ms (± 0.14%)228.08ms (± 0.16%)+0.18ms (+ 0.08%)226.61ms233.88msp=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time227.42ms (± 0.14%)227.29ms (± 0.16%)-0.14ms (- 0.06%)225.70ms232.62msp=0.000 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Jun 27, 2024

Copy link
Copy Markdown
MemberAuthor

In some experiments on internal codebases, this seems to shave off maybe 200-300ms depending on the project (they are using pretty big lists of path mappings), but it looks like it ends up in a situation where the function gets called with two different arrays in an interleaving way. So instead of a single-slot cache, I added a WeakMap.

TypeScript Bot (@typescript-bot) test top400
TypeScript Bot (@typescript-bot) perf test this
TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
test top400✅ Started✅ Results
perf test this✅ Started👀 Results
pack this✅ Started✅ Results

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

Hey Daniel Rosenwasser (@DanielRosenwasser), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/162471/artifacts?artifactName=tgz&fileId=E81886FA4EB3F7B8BEB31252C9121DC5B98039962996BF8EF2C70B005CCCAED902&fileName=/typescript-5.6.0-insiders.20240627.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.6.0-pr-59048-8".;

Comment threadsrc/compiler/core.ts Outdated
for (let i = 0; i < endIndex; i++) {
const v = values[i];
const pattern = getPattern(v);
if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) {

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.

Wouldn't it be better to run these conditions in the reverse order? No point in running the cost of pattern matching if the pattern to be matched is a worse fit than the current best.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

In practice, what will probably happen is we'll have an empty prefix, that'll match, and then everything after will still need to be checked. It probably makes sense to walk the list backwards looking for a match in case a long match is found, and then bail out as soon as an entry with a shorter prefix length is encountered.

Comment threadsrc/compiler/utilities.ts Outdated
return undefined;
}

let index = binarySearchKey(sortedPatterns, candidate, getPatternPrefix, compareStringsCaseSensitive);

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.

In Rush we have to efficiently match a large array of Git file paths to project prefixes as part of hashing our input states; for that we use this class which you might find useful for this application: https://github.com/microsoft/rushstack/blob/main/libraries/rush-lib/src/logic/LookupByPath.ts

@dmichon-msftDavid Michon (dmichon-msft)Jun 27, 2024

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.

For some numbers, that tool matches 142936 unique file paths to 1279 unique path prefixes in 62 milliseconds on my codespace machine (single threaded). This is without taking any advantage of that the list of paths returned by Git are technically sorted.

@typescript-bot

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
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15362,153~~~p=1.000 n=6
Types50,24250,242~~~p=1.000 n=6
Memory used193,340k (± 0.97%)193,966k (± 1.02%)~192,152k195,829kp=0.173 n=6
Parse Time1.57s (± 0.94%)1.58s (± 0.26%)~1.58s1.59sp=0.210 n=6
Bind Time0.86s (± 1.23%)0.86s (± 1.04%)~0.85s0.87sp=0.452 n=6
Check Time11.19s (± 0.28%)11.23s (± 0.26%)+0.05s (+ 0.42%)11.20s11.28sp=0.030 n=6
Emit Time3.27s (± 0.76%)3.28s (± 0.57%)~3.26s3.31sp=0.292 n=6
Total Time16.89s (± 0.23%)16.96s (± 0.23%)+0.07s (+ 0.43%)16.92s17.02sp=0.024 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,114944,114~~~p=1.000 n=6
Types407,050407,050~~~p=1.000 n=6
Memory used1,218,353k (± 0.00%)1,218,354k (± 0.00%)~1,218,307k1,218,402kp=0.688 n=6
Parse Time7.95s (± 0.59%)7.98s (± 0.77%)~7.90s8.09sp=0.332 n=6
Bind Time2.22s (± 0.44%)2.24s (± 0.34%)+0.02s (+ 0.90%)2.23s2.25sp=0.010 n=6
Check Time35.75s (± 0.36%)35.71s (± 0.31%)~35.59s35.86sp=0.630 n=6
Emit Time16.19s (± 0.43%)16.12s (± 0.98%)~15.93s16.40sp=0.148 n=6
Total Time62.10s (± 0.27%)62.05s (± 0.39%)~61.76s62.44sp=0.575 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,133,0502,133,050~~~p=1.000 n=6
Types926,444926,444~~~p=1.000 n=6
Memory used2,115,431k (± 0.00%)2,115,624k (± 0.00%)+193k (+ 0.01%)2,115,565k2,115,656kp=0.005 n=6
Parse Time6.64s (± 0.42%)6.64s (± 0.21%)~6.63s6.66sp=0.935 n=6
Bind Time2.33s (± 0.83%)2.29s (± 0.24%)-0.04s (- 1.57%)2.29s2.30sp=0.008 n=6
Check Time70.64s (± 0.39%)70.88s (± 0.25%)~70.66s71.10sp=0.125 n=6
Emit Time0.14s (± 2.95%)0.14s (± 4.05%)~0.13s0.14sp=0.282 n=6
Total Time79.75s (± 0.36%)79.95s (± 0.24%)~79.71s80.19sp=0.229 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,231,6401,231,694+54 (+ 0.00%)~~p=0.001 n=6
Types261,187261,201+14 (+ 0.01%)~~p=0.001 n=6
Memory used2,348,149k (± 0.06%)2,348,480k (± 0.08%)~2,346,242k2,350,405kp=0.936 n=6
Parse Time6.07s (± 0.96%)6.01s (± 1.17%)~5.91s6.13sp=0.199 n=6
Bind Time2.27s (± 0.56%)2.31s (± 0.65%)+0.04s (+ 1.62%)2.29s2.33sp=0.005 n=6
Check Time40.17s (± 0.48%)40.12s (± 0.45%)~39.90s40.35sp=0.936 n=6
Emit Time3.25s (± 4.29%)3.24s (± 5.51%)~3.05s3.51sp=0.936 n=6
Total Time51.77s (± 0.41%)51.70s (± 0.72%)~51.29s52.32sp=0.575 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,231,6401,231,694+54 (+ 0.00%)~~p=0.001 n=6
Types261,187261,201+14 (+ 0.01%)~~p=0.001 n=6
Memory used2,424,382k (± 0.04%)2,424,553k (± 0.03%)~2,423,438k2,425,674kp=0.689 n=6
Parse Time6.25s (± 0.78%)6.24s (± 0.44%)~6.20s6.27sp=0.872 n=6
Bind Time2.05s (± 0.82%)2.05s (± 0.65%)~2.03s2.06sp=1.000 n=6
Check Time40.62s (± 0.20%)40.61s (± 0.27%)~40.45s40.78sp=0.748 n=6
Emit Time3.21s (± 2.21%)3.21s (± 1.79%)~3.14s3.31sp=0.936 n=6
Total Time52.13s (± 0.25%)52.12s (± 0.18%)~51.99s52.25sp=0.689 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,818258,861+43 (+ 0.02%)~~p=0.001 n=6
Types104,842104,856+14 (+ 0.01%)~~p=0.001 n=6
Memory used428,208k (± 0.01%)428,324k (± 0.01%)+115k (+ 0.03%)428,243k428,408kp=0.008 n=6
Parse Time3.31s (± 0.53%)3.32s (± 0.44%)~3.30s3.34sp=0.417 n=6
Bind Time1.32s (± 1.34%)1.31s (± 1.28%)~1.29s1.34sp=0.607 n=6
Check Time17.80s (± 0.29%)17.73s (± 0.34%)~17.65s17.80sp=0.107 n=6
Emit Time1.37s (± 1.30%)1.38s (± 1.16%)~1.36s1.40sp=0.251 n=6
Total Time23.80s (± 0.17%)23.75s (± 0.30%)~23.65s23.82sp=0.332 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,565224,565~~~p=1.000 n=6
Types93,73493,734~~~p=1.000 n=6
Memory used369,609k (± 0.02%)369,461k (± 0.02%)-148k (- 0.04%)369,362k369,590kp=0.031 n=6
Parse Time2.76s (± 1.22%)2.78s (± 0.78%)~2.74s2.80sp=0.372 n=6
Bind Time1.58s (± 1.01%)1.58s (± 1.37%)~1.56s1.62sp=0.870 n=6
Check Time15.44s (± 0.38%)15.46s (± 0.29%)~15.42s15.54sp=0.329 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time19.78s (± 0.43%)19.83s (± 0.34%)~19.74s19.92sp=0.261 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,878,6292,878,629~~~p=1.000 n=6
Types975,177975,177~~~p=1.000 n=6
Memory used3,042,136k (± 0.00%)3,042,112k (± 0.00%)~3,042,043k3,042,169kp=0.574 n=6
Parse Time13.56s (± 0.30%)13.57s (± 0.55%)~13.47s13.70sp=0.630 n=6
Bind Time4.18s (± 0.36%)4.18s (± 0.43%)~4.15s4.20sp=0.803 n=6
Check Time73.39s (± 0.58%)73.47s (± 0.20%)~73.30s73.64sp=0.810 n=6
Emit Time23.98s (± 0.53%)23.98s (± 0.50%)~23.77s24.09sp=0.936 n=6
Total Time115.12s (± 0.34%)115.20s (± 0.12%)~115.02s115.40sp=0.575 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols267,117267,117~~~p=1.000 n=6
Types108,775108,775~~~p=1.000 n=6
Memory used411,554k (± 0.01%)411,590k (± 0.02%)~411,523k411,708kp=0.173 n=6
Parse Time3.82s (± 0.61%)3.83s (± 0.60%)~3.80s3.86sp=0.468 n=6
Bind Time1.68s (± 0.32%)1.69s (± 0.44%)~1.68s1.70sp=0.137 n=6
Check Time16.66s (± 0.31%)16.72s (± 0.43%)~16.63s16.84sp=0.173 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.17s (± 0.19%)22.24s (± 0.39%)~22.15s22.38sp=0.102 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols525,251525,251~~~p=1.000 n=6
Types178,574178,574~~~p=1.000 n=6
Memory used462,848k (± 0.08%)462,785k (± 0.10%)~462,361k463,326kp=0.810 n=6
Parse Time2.65s (± 0.69%)2.64s (± 0.41%)~2.62s2.65sp=0.161 n=6
Bind Time0.98s (± 0.42%)0.98s (± 0.42%)~0.97s0.98sp=1.000 n=6
Check Time15.14s (± 0.27%)15.20s (± 0.42%)~15.12s15.28sp=0.196 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.77s (± 0.28%)18.82s (± 0.34%)~18.75s18.90sp=0.261 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,752ms (± 0.56%)2,767ms (± 0.52%)~2,749ms2,787msp=0.173 n=6
Req 2 - geterr6,910ms (± 9.53%)6,700ms (±10.31%)~6,031ms7,366msp=0.689 n=6
Req 3 - references370ms (±10.88%)360ms (±10.56%)~318ms395msp=0.374 n=6
Req 4 - navto328ms (± 7.02%)330ms (± 7.42%)~280ms341msp=1.000 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo122ms (±14.58%)123ms (±10.39%)~106ms132msp=0.868 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,612ms (± 1.12%)3,581ms (± 0.51%)~3,559ms3,611msp=0.128 n=6
Req 2 - geterr5,540ms (± 0.41%)5,552ms (± 0.81%)~5,497ms5,605msp=0.936 n=6
Req 3 - references417ms (± 0.24%)416ms (± 0.25%)~415ms418msp=0.203 n=6
Req 4 - navto340ms (± 1.81%)337ms (± 0.32%)~335ms338msp=0.622 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo110ms (± 0.96%)109ms (± 0.94%)~108ms110msp=0.931 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen6,610ms (± 6.12%)6,218ms (± 0.57%)~6,191ms6,287msp=0.054 n=6
Req 2 - geterr1,571ms (± 9.77%)1,624ms (± 7.88%)~1,365ms1,697msp=0.470 n=6
Req 3 - references111ms (± 0.47%)112ms (± 2.55%)~111ms118msp=0.114 n=6
Req 4 - navto596ms (± 2.51%)603ms (± 1.42%)~592ms615msp=0.470 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo1,237ms (± 1.44%)1,238ms (± 1.11%)~1,225ms1,260msp=0.936 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time157.34ms (± 0.15%)157.40ms (± 0.17%)~156.33ms160.83msp=0.113 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time232.29ms (± 0.13%)232.38ms (± 0.16%)+0.09ms (+ 0.04%)231.00ms236.02msp=0.042 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time340.27ms (± 0.31%)340.61ms (± 0.31%)+0.34ms (+ 0.10%)332.17ms346.22msp=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time227.38ms (± 0.15%)227.50ms (± 0.16%)+0.11ms (+ 0.05%)226.07ms231.05msp=0.009 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Jun 27, 2024

Copy link
Copy Markdown
MemberAuthor

I think the latest change helped a bit; however, it seems like frequently this function ends up with an (effectively) identical list every single time with different reference equality. So I've tried adding an earlier cache. I'll see if that helps.

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
pack this✅ Started✅ Results

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

Hey Daniel Rosenwasser (@DanielRosenwasser), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/162476/artifacts?artifactName=tgz&fileId=9683B5E6F6215D023679DE14CBF28D3038EEB938A0C5B3E05A39FA272049907B02&fileName=/typescript-5.6.0-insiders.20240627.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.6.0-pr-59048-12".;

@DanielRosenwasser

Copy link
Copy Markdown
MemberAuthor

For whatever reason, I'm still seeing at least one occurrence of an identical path array being passed in; but I think this is pretty ready for review.

@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) marked this pull request as ready for review June 27, 2024 19:43
@DanielRosenwasser

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this
TypeScript Bot (@typescript-bot) test tsserver top400
TypeScript Bot (@typescript-bot) test top400

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this✅ Started👀 Results
test tsserver top400✅ Started👀 Results
test top400✅ Started✅ Results

Comment threadsrc/compiler/utilities.ts Outdated
@DanielRosenwasser

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) pack this
TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 28, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
pack this✅ Started✅ Results
perf test this✅ Started👀 Results

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 28, 2024

Copy link
Copy Markdown
Contributor

Hey Daniel Rosenwasser (@DanielRosenwasser), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/162492/artifacts?artifactName=tgz&fileId=9A43BB1F5015C8E1240596441929304490B5CF692A75D0C591BEAA8E193450A502&fileName=/typescript-5.6.0-insiders.20240628.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.6.0-pr-59048-28".;

@typescript-bot

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
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15362,153~~~p=1.000 n=6
Types50,24250,242~~~p=1.000 n=6
Memory used192,254k (± 0.10%)192,794k (± 0.75%)~192,070k195,722kp=0.873 n=6
Parse Time1.31s (± 0.62%)1.32s (± 0.92%)~1.31s1.34sp=0.115 n=6
Bind Time0.71s0.71s (± 0.89%)~0.70s0.72sp=1.000 n=6
Check Time9.43s (± 0.33%)9.45s (± 0.40%)~9.40s9.50sp=0.335 n=6
Emit Time2.73s (± 0.31%)2.74s (± 0.20%)~2.74s2.75sp=0.052 n=6
Total Time14.18s (± 0.18%)14.22s (± 0.34%)~14.17s14.28sp=0.227 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,114944,114~~~p=1.000 n=6
Types407,050407,050~~~p=1.000 n=6
Memory used1,218,319k (± 0.00%)1,218,300k (± 0.00%)~1,218,259k1,218,326kp=0.297 n=6
Parse Time7.96s (± 0.50%)7.98s (± 0.57%)~7.93s8.04sp=0.518 n=6
Bind Time2.22s (± 0.46%)2.23s (± 0.38%)~2.21s2.23sp=0.672 n=6
Check Time35.78s (± 0.48%)35.73s (± 0.45%)~35.52s35.88sp=1.000 n=6
Emit Time16.20s (± 0.49%)16.12s (± 0.50%)~15.99s16.21sp=0.172 n=6
Total Time62.16s (± 0.30%)62.05s (± 0.38%)~61.72s62.31sp=0.520 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,133,0502,133,050~~~p=1.000 n=6
Types926,444926,444~~~p=1.000 n=6
Memory used2,115,331k (± 0.00%)2,115,377k (± 0.00%)~2,115,273k2,115,544kp=0.298 n=6
Parse Time9.72s (± 0.22%)9.71s (± 0.49%)~9.63s9.76sp=0.747 n=6
Bind Time3.38s (± 0.70%)3.37s (± 0.95%)~3.33s3.40sp=0.375 n=6
Check Time101.94s (± 0.43%)102.17s (± 0.57%)~101.29s103.00sp=0.630 n=6
Emit Time0.20s (± 4.95%)0.20s (± 4.47%)~0.19s0.21sp=0.798 n=6
Total Time115.24s (± 0.38%)115.45s (± 0.49%)~114.59s116.24sp=0.810 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,224,3311,224,413+82 (+ 0.01%)~~p=0.001 n=6
Types261,007260,990-17 (- 0.01%)~~p=0.001 n=6
Memory used2,339,417k (± 0.03%)2,340,110k (± 0.04%)~2,339,197k2,341,110kp=0.173 n=6
Parse Time6.03s (± 0.64%)5.99s (± 0.73%)~5.94s6.05sp=0.128 n=6
Bind Time2.26s (± 0.46%)2.25s (± 0.71%)~2.24s2.28sp=0.191 n=6
Check Time40.07s (± 0.24%)40.10s (± 0.31%)~39.91s40.21sp=0.521 n=6
Emit Time3.17s (± 2.10%)3.12s (± 1.49%)~3.07s3.19sp=0.173 n=6
Total Time51.53s (± 0.24%)51.46s (± 0.24%)~51.27s51.61sp=0.230 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,224,3311,224,413+82 (+ 0.01%)~~p=0.001 n=6
Types261,007260,990-17 (- 0.01%)~~p=0.001 n=6
Memory used2,412,890k (± 0.03%)2,423,234k (± 1.01%)~2,411,661k2,473,314kp=0.471 n=6
Parse Time6.30s (± 0.75%)6.24s (± 1.08%)~6.14s6.34sp=0.108 n=6
Bind Time2.02s (± 0.81%)2.04s (± 0.97%)~2.01s2.07sp=0.140 n=6
Check Time40.76s (± 0.49%)40.74s (± 0.31%)~40.60s40.96sp=1.000 n=6
Emit Time3.27s (± 1.90%)3.23s (± 2.42%)~3.14s3.36sp=0.378 n=6
Total Time52.35s (± 0.35%)52.25s (± 0.36%)~52.03s52.53sp=0.378 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,166258,160-6 (- 0.00%)~~p=0.001 n=6
Types104,689104,672-17 (- 0.02%)~~p=0.001 n=6
Memory used427,337k (± 0.01%)427,387k (± 0.01%)~427,345k427,473kp=0.173 n=6
Parse Time3.29s (± 0.54%)3.29s (± 1.17%)~3.24s3.33sp=1.000 n=6
Bind Time1.31s (± 0.92%)1.31s (± 0.92%)~1.29s1.32sp=1.000 n=6
Check Time17.77s (± 0.41%)17.77s (± 0.50%)~17.67s17.89sp=1.000 n=6
Emit Time1.40s (± 1.11%)1.40s (± 1.40%)~1.38s1.42sp=0.935 n=6
Total Time23.78s (± 0.31%)23.78s (± 0.32%)~23.71s23.92sp=1.000 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,565224,565~~~p=1.000 n=6
Types93,73493,734~~~p=1.000 n=6
Memory used369,473k (± 0.01%)369,467k (± 0.02%)~369,368k369,576kp=0.936 n=6
Parse Time2.77s (± 0.50%)2.77s (± 1.01%)~2.75s2.81sp=0.935 n=6
Bind Time1.59s (± 0.40%)1.60s (± 1.02%)~1.58s1.62sp=0.615 n=6
Check Time15.47s (± 0.20%)15.48s (± 0.36%)~15.41s15.56sp=0.748 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time19.82s (± 0.20%)19.85s (± 0.31%)~19.74s19.92sp=0.332 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,878,6312,878,631~~~p=1.000 n=6
Types975,177975,177~~~p=1.000 n=6
Memory used3,042,169k (± 0.00%)3,042,135k (± 0.00%)~3,042,089k3,042,172kp=0.575 n=6
Parse Time13.58s (± 0.37%)13.52s (± 0.34%)~13.48s13.59sp=0.077 n=6
Bind Time4.23s (± 1.87%)4.19s (± 0.90%)~4.16s4.26sp=0.061 n=6
Check Time73.34s (± 0.25%)73.07s (± 0.19%)-0.27s (- 0.37%)72.87s73.21sp=0.020 n=6
Emit Time24.00s (± 0.92%)23.93s (± 0.37%)~23.79s24.04sp=0.873 n=6
Total Time115.15s (± 0.33%)114.71s (± 0.17%)-0.44s (- 0.38%)114.45s114.89sp=0.031 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols267,117267,117~~~p=1.000 n=6
Types108,775108,775~~~p=1.000 n=6
Memory used411,567k (± 0.02%)411,545k (± 0.01%)~411,504k411,593kp=1.000 n=6
Parse Time3.19s (± 0.34%)3.17s (± 0.85%)~3.14s3.20sp=0.289 n=6
Bind Time1.41s (± 0.53%)1.42s (± 0.36%)~1.41s1.42sp=0.069 n=6
Check Time14.23s (± 0.45%)14.22s (± 0.33%)~14.15s14.29sp=0.748 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.83s (± 0.36%)18.81s (± 0.31%)~18.71s18.88sp=0.470 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols525,251525,251~~~p=1.000 n=6
Types178,574178,574~~~p=1.000 n=6
Memory used463,025k (± 0.07%)462,890k (± 0.08%)~462,387k463,286kp=0.575 n=6
Parse Time2.66s (± 0.37%)2.66s (± 0.39%)~2.64s2.67sp=0.315 n=6
Bind Time0.98s (± 0.42%)0.98s (± 0.42%)~0.97s0.98sp=1.000 n=6
Check Time15.17s (± 0.42%)15.18s (± 0.40%)~15.10s15.28sp=0.684 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.81s (± 0.33%)18.82s (± 0.30%)~18.72s18.89sp=0.809 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,301ms (± 0.18%)2,299ms (± 0.47%)~2,281ms2,313msp=0.872 n=6
Req 2 - geterr5,072ms (± 0.52%)5,062ms (± 0.53%)~5,018ms5,095msp=0.810 n=6
Req 3 - references264ms (± 0.15%)265ms (± 0.21%)~264ms265msp=0.054 n=6
Req 4 - navto227ms (± 0.95%)227ms (± 0.90%)~223ms228msp=0.673 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo90ms (± 2.62%)89ms (± 2.17%)~88ms93msp=0.858 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,573ms (± 0.39%)3,568ms (± 0.91%)~3,514ms3,598msp=1.000 n=6
Req 2 - geterr5,547ms (± 0.35%)5,534ms (± 0.34%)~5,501ms5,559msp=0.127 n=6
Req 3 - references417ms (± 0.63%)417ms (± 0.40%)~415ms419msp=0.742 n=6
Req 4 - navto342ms (± 2.09%)337ms (± 1.01%)~331ms341msp=0.462 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo109ms (± 2.59%)114ms (± 6.74%)~108ms125msp=0.413 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen5,193ms (± 0.65%)5,198ms (± 0.33%)~5,165ms5,213msp=1.000 n=6
Req 2 - geterr1,122ms (± 2.25%)1,128ms (± 0.94%)~1,120ms1,148msp=0.630 n=6
Req 3 - references77ms (± 3.98%)77ms (± 3.56%)~75ms82msp=0.866 n=6
Req 4 - navto458ms (± 0.74%)459ms (± 0.81%)~456ms466msp=0.720 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo835ms (± 1.49%)833ms (± 1.43%)~813ms844msp=0.873 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time228.75ms (± 0.17%)228.75ms (± 0.15%)~226.86ms232.08msp=0.294 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time231.66ms (± 0.15%)231.54ms (± 0.13%)-0.12ms (- 0.05%)229.99ms235.13msp=0.001 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time226.85ms (± 0.16%)226.72ms (± 0.14%)-0.13ms (- 0.06%)225.57ms231.37msp=0.001 n=600
typescript-startup - node (v18.15.0, x64)
Execution time226.49ms (± 0.15%)226.30ms (± 0.15%)-0.19ms (- 0.09%)225.10ms230.73msp=0.000 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@DanielRosenwasserDaniel Rosenwasser (DanielRosenwasser) changed the title Use a Set and a binary search to search for patterns on pathsOptimize path mapping lookupsJun 28, 2024
@DanielRosenwasser

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) pack this
TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 28, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
pack this✅ Started✅ Results
perf test this✅ Started👀 Results

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 28, 2024

Copy link
Copy Markdown
Contributor

Hey Daniel Rosenwasser (@DanielRosenwasser), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/162513/artifacts?artifactName=tgz&fileId=FE69A9E299527A889B20AB1EFDCCC750B25244355428604098F9E59D6BA8F0E402&fileName=/typescript-5.6.0-insiders.20240628.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.6.0-pr-59048-32".;

@typescript-bot

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
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15362,153~~~p=1.000 n=6
Types50,24250,242~~~p=1.000 n=6
Memory used193,322k (± 0.96%)192,829k (± 0.75%)~192,145k195,769kp=0.230 n=6
Parse Time1.58s (± 0.78%)1.58s (± 0.35%)~1.57s1.58sp=0.863 n=6
Bind Time0.87s (± 0.63%)0.85s (± 0.61%)-0.02s (- 2.12%)0.84s0.85sp=0.004 n=6
Check Time11.21s (± 0.59%)11.22s (± 0.49%)~11.15s11.30sp=0.873 n=6
Emit Time3.27s (± 0.72%)3.28s (± 0.71%)~3.26s3.32sp=0.418 n=6
Total Time16.92s (± 0.39%)16.93s (± 0.45%)~16.83s17.05sp=0.936 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,114944,114~~~p=1.000 n=6
Types407,050407,050~~~p=1.000 n=6
Memory used1,218,349k (± 0.00%)1,218,347k (± 0.00%)~1,218,280k1,218,392kp=0.810 n=6
Parse Time6.68s (± 0.58%)6.65s (± 1.06%)~6.58s6.75sp=0.422 n=6
Bind Time1.87s (± 0.40%)1.87s (± 0.55%)~1.85s1.88sp=0.437 n=6
Check Time30.64s (± 0.35%)30.64s (± 0.44%)~30.45s30.77sp=0.936 n=6
Emit Time13.52s (± 0.57%)13.56s (± 0.27%)~13.51s13.61sp=0.521 n=6
Total Time52.71s (± 0.35%)52.71s (± 0.27%)~52.55s52.91sp=1.000 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,133,0392,133,039~~~p=1.000 n=6
Types926,444926,444~~~p=1.000 n=6
Memory used2,115,360k (± 0.01%)2,115,311k (± 0.00%)~2,115,215k2,115,355kp=0.630 n=6
Parse Time7.91s (± 0.54%)7.90s (± 0.37%)~7.85s7.94sp=0.571 n=6
Bind Time2.78s (± 0.53%)2.76s (± 0.63%)~2.73s2.78sp=0.070 n=6
Check Time84.01s (± 0.50%)83.71s (± 0.47%)~83.18s84.27sp=0.261 n=6
Emit Time0.15s (± 3.53%)0.16s (± 5.21%)~0.15s0.17sp=0.859 n=6
Total Time94.85s (± 0.42%)94.52s (± 0.41%)~94.05s95.10sp=0.173 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,224,3311,224,347+16 (+ 0.00%)~~p=0.001 n=6
Types261,007260,987-20 (- 0.01%)~~p=0.001 n=6
Memory used2,339,541k (± 0.03%)2,339,992k (± 0.04%)~2,338,492k2,340,932kp=0.471 n=6
Parse Time6.02s (± 0.93%)5.93s (± 0.68%)-0.09s (- 1.47%)5.89s5.99sp=0.025 n=6
Bind Time2.23s (± 0.80%)2.25s (± 0.44%)+0.02s (+ 0.97%)2.24s2.26sp=0.028 n=6
Check Time40.04s (± 0.18%)40.03s (± 0.24%)~39.94s40.18sp=0.687 n=6
Emit Time3.13s (± 2.42%)3.14s (± 3.00%)~3.06s3.30sp=0.689 n=6
Total Time51.43s (± 0.20%)51.37s (± 0.26%)~51.24s51.61sp=0.298 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,224,3311,224,347+16 (+ 0.00%)~~p=0.001 n=6
Types261,007260,987-20 (- 0.01%)~~p=0.001 n=6
Memory used2,412,725k (± 0.02%)2,412,957k (± 0.03%)~2,412,029k2,413,996kp=0.810 n=6
Parse Time6.25s (± 0.56%)6.24s (± 1.08%)~6.15s6.34sp=0.936 n=6
Bind Time2.01s (± 1.21%)2.01s (± 1.16%)~1.99s2.05sp=0.570 n=6
Check Time40.58s (± 0.26%)40.61s (± 0.33%)~40.37s40.73sp=0.471 n=6
Emit Time3.22s (± 1.55%)3.22s (± 2.20%)~3.13s3.31sp=0.748 n=6
Total Time52.06s (± 0.23%)52.10s (± 0.27%)~51.94s52.36sp=0.873 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,166258,138-28 (- 0.01%)~~p=0.001 n=6
Types104,689104,669-20 (- 0.02%)~~p=0.001 n=6
Memory used427,355k (± 0.01%)427,351k (± 0.01%)~427,303k427,411kp=0.575 n=6
Parse Time2.72s (± 1.06%)2.75s (± 1.00%)~2.72s2.78sp=0.126 n=6
Bind Time1.11s (± 0.47%)1.10s (± 1.10%)~1.08s1.11sp=0.923 n=6
Check Time15.13s (± 0.19%)15.08s (± 0.25%)-0.05s (- 0.36%)15.03s15.14sp=0.034 n=6
Emit Time1.19s (± 0.92%)1.19s (± 0.69%)~1.18s1.20sp=0.662 n=6
Total Time20.15s (± 0.23%)20.12s (± 0.18%)~20.07s20.16sp=0.169 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,565224,565~~~p=1.000 n=6
Types93,73493,734~~~p=1.000 n=6
Memory used369,582k (± 0.04%)369,567k (± 0.04%)~369,406k369,734kp=0.936 n=6
Parse Time2.77s (± 0.70%)2.77s (± 0.44%)~2.76s2.79sp=0.514 n=6
Bind Time1.59s (± 1.08%)1.58s (± 0.74%)~1.57s1.60sp=0.557 n=6
Check Time15.46s (± 0.25%)15.51s (± 0.21%)~15.45s15.54sp=0.053 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time19.81s (± 0.19%)19.87s (± 0.15%)+0.05s (+ 0.27%)19.81s19.89sp=0.044 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,878,9402,878,940~~~p=1.000 n=6
Types975,074975,074~~~p=1.000 n=6
Memory used3,041,804k (± 0.00%)3,041,773k (± 0.00%)~3,041,705k3,041,831kp=0.378 n=6
Parse Time13.70s (± 0.20%)13.68s (± 0.24%)~13.63s13.71sp=0.197 n=6
Bind Time4.26s (± 2.91%)4.19s (± 0.56%)~4.16s4.22sp=0.169 n=6
Check Time74.73s (± 2.00%)74.31s (± 1.86%)~73.56s77.13sp=0.423 n=6
Emit Time23.19s (± 6.73%)23.66s (± 6.61%)~20.47s24.40sp=0.378 n=6
Total Time115.88s (± 0.20%)115.84s (± 0.25%)~115.45s116.19sp=0.810 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols267,117267,117~~~p=1.000 n=6
Types108,775108,775~~~p=1.000 n=6
Memory used411,562k (± 0.01%)411,511k (± 0.01%)~411,443k411,581kp=0.128 n=6
Parse Time3.81s (± 0.46%)3.83s (± 0.75%)~3.80s3.87sp=0.183 n=6
Bind Time1.69s (± 0.44%)1.70s (± 0.58%)~1.69s1.71sp=0.300 n=6
Check Time16.77s (± 0.22%)16.77s (± 0.17%)~16.74s16.82sp=0.936 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.26s (± 0.21%)22.29s (± 0.15%)~22.25s22.34sp=0.332 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols525,251525,251~~~p=1.000 n=6
Types178,574178,574~~~p=1.000 n=6
Memory used462,961k (± 0.10%)463,167k (± 0.02%)~463,108k463,338kp=0.810 n=6
Parse Time2.64s (± 0.39%)2.65s (± 0.48%)~2.64s2.67sp=0.391 n=6
Bind Time0.98s (± 0.42%)0.98s (± 0.64%)~0.97s0.99sp=0.673 n=6
Check Time15.19s (± 0.51%)15.15s (± 0.14%)~15.12s15.17sp=0.375 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.81s (± 0.38%)18.78s (± 0.08%)~18.76s18.79sp=0.463 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,863ms (± 9.64%)2,768ms (± 0.98%)~2,728ms2,800msp=1.000 n=6
Req 2 - geterr6,291ms (± 8.40%)6,252ms (± 8.12%)~6,006ms7,288msp=0.230 n=6
Req 3 - references357ms (±11.34%)386ms (± 5.20%)~345ms396msp=0.170 n=6
Req 4 - navto330ms (± 8.01%)338ms (± 1.30%)~331ms343msp=0.935 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo128ms (± 7.11%)136ms (± 3.27%)🔻+9ms (+ 6.93%)132ms144msp=0.005 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,426ms (± 0.65%)2,412ms (± 0.78%)~2,392ms2,446msp=0.230 n=6
Req 2 - geterr3,800ms (± 0.43%)3,798ms (± 0.30%)~3,781ms3,813msp=0.873 n=6
Req 3 - references278ms (± 0.37%)277ms (± 1.23%)~271ms280msp=0.870 n=6
Req 4 - navto226ms (± 0.46%)229ms (± 2.36%)~226ms240msp=0.176 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo74ms (± 7.44%)77ms (±11.73%)~67ms85msp=0.808 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen6,218ms (± 0.31%)6,241ms (± 0.19%)+23ms (+ 0.36%)6,223ms6,256msp=0.030 n=6
Req 2 - geterr1,637ms (± 8.14%)1,626ms (± 7.79%)~1,371ms1,706msp=0.873 n=6
Req 3 - references111ms (± 6.30%)116ms (± 5.05%)~110ms122msp=0.343 n=6
Req 4 - navto589ms (± 3.37%)601ms (± 3.42%)~581ms627msp=0.289 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo1,223ms (± 7.32%)1,264ms (± 2.25%)~1,233ms1,299msp=0.689 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time157.06ms (± 0.16%)157.23ms (± 0.19%)+0.17ms (+ 0.11%)156.18ms162.30msp=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time231.36ms (± 0.14%)231.32ms (± 0.13%)~229.89ms233.93msp=0.316 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time338.10ms (± 0.30%)338.08ms (± 0.30%)~329.94ms344.07msp=0.530 n=600
typescript-startup - node (v18.15.0, x64)
Execution time226.35ms (± 0.16%)226.43ms (± 0.19%)~224.97ms232.33msp=0.349 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@DanielRosenwasser

Copy link
Copy Markdown
MemberAuthor

The current state of this just always caches the objects and divides the entries into exact specifiers (as a Set) and an array of patterns as written. This still helps the internal codebase in question since about half of the entries in the huge list are non-pattern specifiers.

I'm open to re-introducing the binary search. It probably still makes sense to sort the array and iterate backwards to find a match and bail earlier when possible. But apparently we don't seem to have a test where suffix length matters in the case of exports, and I'd need someone to make sure I get the details there right.

@DanielRosenwasser

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 11, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this✅ Started👀 Results

@typescript-bot

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
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15362,153~~~p=1.000 n=6
Types50,24250,242~~~p=1.000 n=6
Memory used193,366k (± 0.95%)193,416k (± 0.93%)~192,147k195,749kp=0.810 n=6
Parse Time1.57s (± 1.51%)1.57s (± 0.94%)~1.55s1.58sp=0.676 n=6
Bind Time0.86s (± 0.88%)0.86s (± 0.88%)~0.85s0.87sp=1.000 n=6
Check Time11.19s (± 0.13%)11.17s (± 0.68%)~11.06s11.24sp=0.872 n=6
Emit Time3.27s (± 0.65%)3.25s (± 0.72%)~3.22s3.28sp=0.089 n=6
Total Time16.89s (± 0.20%)16.84s (± 0.55%)~16.73s16.97sp=0.470 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,114944,114~~~p=1.000 n=6
Types407,050407,050~~~p=1.000 n=6
Memory used1,218,358k (± 0.00%)1,218,384k (± 0.00%)~1,218,350k1,218,428kp=0.199 n=6
Parse Time7.99s (± 0.93%)7.98s (± 0.37%)~7.95s8.03sp=0.936 n=6
Bind Time2.23s (± 0.52%)2.23s (± 0.34%)~2.22s2.24sp=0.396 n=6
Check Time35.82s (± 0.41%)35.80s (± 0.33%)~35.60s35.90sp=0.629 n=6
Emit Time16.25s (± 0.59%)16.18s (± 0.41%)~16.12s16.27sp=0.146 n=6
Total Time62.30s (± 0.11%)62.18s (± 0.25%)~61.94s62.38sp=0.128 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,130,2962,130,296~~~p=1.000 n=6
Types927,656927,656~~~p=1.000 n=6
Memory used2,107,127k (± 0.01%)2,107,082k (± 0.01%)~2,106,817k2,107,348kp=0.689 n=6
Parse Time9.65s (± 0.38%)9.65s (± 0.65%)~9.59s9.77sp=0.462 n=6
Bind Time3.37s (± 0.83%)3.38s (± 1.10%)~3.32s3.43sp=0.422 n=6
Check Time102.50s (± 0.33%)101.60s (± 1.52%)~99.61s103.19sp=0.471 n=6
Emit Time0.19s (± 2.81%)0.20s (± 5.89%)~0.19s0.22sp=0.859 n=6
Total Time115.72s (± 0.31%)114.82s (± 1.29%)~112.87s116.39sp=0.423 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,226,0051,226,001-4 (- 0.00%)~~p=0.001 n=6
Types261,615261,591-24 (- 0.01%)~~p=0.001 n=6
Memory used2,338,926k (± 0.01%)2,339,355k (± 0.01%)~2,339,004k2,339,828kp=0.066 n=6
Parse Time7.60s (± 0.58%)7.57s (± 0.77%)~7.46s7.62sp=0.689 n=6
Bind Time2.81s (± 0.52%)2.81s (± 1.24%)~2.76s2.86sp=0.572 n=6
Check Time49.48s (± 0.34%)49.30s (± 0.35%)~49.11s49.62sp=0.173 n=6
Emit Time4.81s (± 2.11%)4.80s (± 0.71%)~4.75s4.84sp=1.000 n=6
Total Time64.71s (± 0.36%)64.50s (± 0.29%)~64.25s64.79sp=0.173 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,226,0051,226,001-4 (- 0.00%)~~p=0.001 n=6
Types261,615261,591-24 (- 0.01%)~~p=0.001 n=6
Memory used2,413,255k (± 0.02%)2,423,592k (± 1.03%)~2,413,254k2,474,457kp=0.378 n=6
Parse Time7.87s (± 1.20%)7.82s (± 1.04%)~7.71s7.95sp=0.336 n=6
Bind Time2.50s (± 1.54%)2.52s (± 1.03%)~2.48s2.55sp=0.377 n=6
Check Time50.20s (± 0.40%)50.07s (± 0.38%)~49.88s50.44sp=0.298 n=6
Emit Time4.81s (± 0.97%)4.84s (± 0.80%)~4.79s4.88sp=0.333 n=6
Total Time65.40s (± 0.36%)65.28s (± 0.18%)~65.22s65.52sp=0.173 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,315258,278-37 (- 0.01%)~~p=0.001 n=6
Types104,817104,793-24 (- 0.02%)~~p=0.001 n=6
Memory used427,193k (± 0.01%)427,242k (± 0.05%)~427,056k427,542kp=0.689 n=6
Parse Time3.30s (± 1.09%)3.30s (± 0.63%)~3.28s3.34sp=0.808 n=6
Bind Time1.32s (± 0.93%)1.31s (± 1.28%)~1.28s1.32sp=0.599 n=6
Check Time17.84s (± 0.43%)17.82s (± 0.29%)~17.74s17.89sp=0.420 n=6
Emit Time1.64s (± 1.13%)1.65s (± 1.85%)~1.61s1.70sp=0.935 n=6
Total Time24.10s (± 0.39%)24.09s (± 0.18%)~24.02s24.14sp=0.873 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,565224,565~~~p=1.000 n=6
Types93,73493,734~~~p=1.000 n=6
Memory used369,481k (± 0.02%)369,552k (± 0.03%)~369,449k369,656kp=0.378 n=6
Parse Time2.77s (± 0.84%)2.77s (± 0.56%)~2.74s2.78sp=0.870 n=6
Bind Time1.58s (± 0.40%)1.59s (± 1.08%)~1.57s1.61sp=0.557 n=6
Check Time15.52s (± 0.33%)15.52s (± 0.34%)~15.42s15.56sp=0.688 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time19.87s (± 0.29%)19.87s (± 0.27%)~19.77s19.91sp=0.421 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,890,4342,890,434~~~p=1.000 n=6
Types977,956977,956~~~p=1.000 n=6
Memory used3,054,070k (± 0.00%)3,054,103k (± 0.00%)~3,053,956k3,054,220kp=0.378 n=6
Parse Time16.88s (± 0.44%)16.92s (± 0.47%)~16.84s17.05sp=0.421 n=6
Bind Time5.13s (± 0.20%)5.11s (± 0.37%)-0.02s (- 0.45%)5.09s5.14sp=0.042 n=6
Check Time89.90s (± 0.46%)90.66s (± 2.31%)~89.51s94.93sp=0.810 n=6
Emit Time29.19s (± 0.91%)28.36s (± 6.66%)~24.51s29.32sp=0.423 n=6
Total Time141.11s (± 0.36%)141.05s (± 0.17%)~140.86s141.50sp=0.936 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols267,239267,239~~~p=1.000 n=6
Types108,815108,815~~~p=1.000 n=6
Memory used411,855k (± 0.02%)411,818k (± 0.01%)~411,754k411,930kp=0.471 n=6
Parse Time3.82s (± 0.43%)3.82s (± 0.78%)~3.79s3.86sp=0.675 n=6
Bind Time1.68s (± 0.70%)1.68s (± 0.97%)~1.66s1.70sp=0.870 n=6
Check Time16.72s (± 0.22%)16.68s (± 0.37%)~16.61s16.77sp=0.228 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.22s (± 0.22%)22.17s (± 0.30%)~22.08s22.24sp=0.334 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols510,475510,475~~~p=1.000 n=6
Types161,600161,600~~~p=1.000 n=6
Memory used447,981k (± 0.08%)447,998k (± 0.08%)~447,554k448,455kp=0.936 n=6
Parse Time2.62s (± 0.71%)2.62s (± 0.67%)~2.60s2.65sp=0.935 n=6
Bind Time0.98s (± 0.84%)0.97s (± 0.53%)~0.97s0.98sp=0.523 n=6
Check Time14.40s (± 0.48%)14.46s (± 0.54%)~14.38s14.59sp=0.199 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.00s (± 0.45%)18.06s (± 0.44%)~17.98s18.19sp=0.296 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,294ms (± 0.42%)2,293ms (± 0.30%)~2,284ms2,305msp=0.573 n=6
Req 2 - geterr5,066ms (± 0.61%)5,060ms (± 0.63%)~4,999ms5,081msp=1.000 n=6
Req 3 - references265ms (± 0.19%)266ms (± 0.19%)~265ms266msp=0.311 n=6
Req 4 - navto228ms (± 0.18%)228ms (± 0.28%)~227ms229msp=0.673 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo93ms (± 3.19%)93ms (± 2.44%)~91ms97msp=0.652 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,424ms (± 1.20%)2,420ms (± 0.96%)~2,392ms2,450msp=0.810 n=6
Req 2 - geterr3,792ms (± 0.40%)3,797ms (± 0.29%)~3,778ms3,809msp=0.575 n=6
Req 3 - references276ms (± 0.42%)277ms (± 0.38%)~275ms278msp=0.619 n=6
Req 4 - navto226ms (± 0.28%)226ms (± 0.33%)~225ms227msp=0.718 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo74ms (± 6.97%)74ms (± 7.51%)~69ms84msp=0.934 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen5,192ms (± 0.57%)5,185ms (± 0.44%)~5,163ms5,227msp=0.810 n=6
Req 2 - geterr1,125ms (± 0.86%)1,121ms (± 2.09%)~1,095ms1,165msp=0.295 n=6
Req 3 - references76ms76ms~~~p=1.000 n=6
Req 4 - navto457ms (± 0.23%)457ms (± 0.16%)~456ms458msp=0.931 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo828ms (± 1.36%)832ms (± 1.39%)~814ms846msp=0.689 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time157.22ms (± 0.16%)157.21ms (± 0.18%)~156.16ms161.26msp=0.427 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time230.55ms (± 0.15%)230.57ms (± 0.18%)~228.98ms237.04msp=0.729 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time226.73ms (± 0.19%)226.67ms (± 0.14%)~225.20ms230.08msp=0.258 n=600
typescript-startup - node (v18.15.0, x64)
Execution time226.02ms (± 0.16%)226.06ms (± 0.15%)~224.36ms228.17msp=0.207 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

Comment threadsrc/compiler/utilities.ts Outdated
return candidate;
}
export function matchPatternOrExact(patternOrStrings: ParsedPatterns, candidate: string): string | Pattern | undefined {
const { matchableStringSet, patterns } = patternOrStrings;

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.

Suggested change
const{ matchableStringSet, patterns }=patternOrStrings;
const{ matchableStringSet, patterns }=parsedPatterns;

just because, well, it's not an array of pattern or string anymore. The comment above this function also needs updating.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@DanielRosenwasser@typescript-bot@weswigham@jakebailey@dmichon-msft