Skip to content

Conversation

@gabritto
Copy link
Member

@gabritto gabritto commented Jan 30, 2023

Fixes #52121.

This PR changes how class member snippet completions are sorted and filtered, and how they interact with class member modifiers.
The problem, as presented in the linked issue, is that class member snippet completions are currently sorted after keyword completions (via sortText), and this is not ideal when you manually request completions inside a class without having typed anything (in other words, when you'd likely want to see the overridable class members first). However, this was done so that member completions that have modifiers do not show up before the modifier keywords when you are typing the modifier.

With this PR, class member completions are sorted before keywords. But a class member protected foo() will have a filter text of foo, meaning that, as you're typing, that member completion will only show up if you're typing a substring of foo (i.e. the editor will match what you're typing to foo, whereas previously it would match what you're typing to the full insert text), so the member completion won't show up as you're typing protected.

I think in general this approach roughly matches what I've seen in other editors/languages (VS+C#, WebStorm+TS, xcode+Swift), and it makes sense to how I'd use it, but I'm looking for feedback on the UX and whether this is the best approach.

Case not supported:

  • async modifier is not inserted/allowed. This has been the case since the initial implementation of class member snippet completions. It's not clear to me if/when we should insert async or allow it to be inserted, open for opinions on that. I vaguely recall that, regarding object method completions, the sentiment around async was that we shouldn't insert it and people could add it after accepting the completion if they wanted.

Not ideal:

  • if one of the class member completions has a class member modifier as its prefix (e.g. a property called publicProperty), it will be sorted before the modifier keyword. I'm hoping that's not common enough to be disruptive, but I might be wrong.
  • if you type modifiers in the wrong order (or the wrong modifiers) for a certain class member, the class member completion will not be displayed. Again, don't know how disruptive that would be, because if your intent is to override a certain class member, you could start by typing its name (or part of its name), instead of starting by typing the member's modifiers.

How to test this in vscode:

@typescript-bot
Copy link
Collaborator

Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @mjbvz, @zkat, and @joj for you. Feel free to loop in other consumers/maintainers if necessary

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Jan 30, 2023
@gabritto
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 30, 2023

Heya @gabritto, I've started to run the tarball bundle task on this PR at 2bdf846. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 30, 2023

Hey @gabritto, 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/144719/artifacts?artifactName=tgz&fileId=33086ECEE8FC0158FB1B0E9CF6A9EAD7049CF0A2FFB3EEBCECEE942010B8C1F402&fileName=/typescript-5.0.0-insiders.20230130.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/[email protected]".;

@andrewbranch
Copy link
Member

if you type modifiers in the wrong order (or the wrong modifiers) for a certain class member, the class member completion will not be displayed. Again, don't know how disruptive that would be, because if your intent is to override a certain class member, you could start by typing its name (or part of its name), instead of starting by typing the member's modifiers.

I know we talked about this before, but can you explain again why this is the case? Suppose you type wrong modifiers, and then trigger completions again after the modifiers. The filterText shouldn’t prevent the completion from showing up—I think I remember you saying the issue is something to do with the replacement span? What if, once you’ve already typed modifiers, both the replacement span and the insert text of the snippet dropped the modifiers? That way, if you type the modifiers incorrectly, you can still get the snippet completion, but your incorrect modifiers will remain, and you may have to fix them—but you also might not, if it’s just a (syntactically legal) order mismatch.

@gabritto
Copy link
Member Author

if you type modifiers in the wrong order (or the wrong modifiers) for a certain class member, the class member completion will not be displayed. Again, don't know how disruptive that would be, because if your intent is to override a certain class member, you could start by typing its name (or part of its name), instead of starting by typing the member's modifiers.

I know we talked about this before, but can you explain again why this is the case? Suppose you type wrong modifiers, and then trigger completions again after the modifiers. The filterText shouldn’t prevent the completion from showing up—I think I remember you saying the issue is something to do with the replacement span? What if, once you’ve already typed modifiers, both the replacement span and the insert text of the snippet dropped the modifiers? That way, if you type the modifiers incorrectly, you can still get the snippet completion, but your incorrect modifiers will remain, and you may have to fix them—but you also might not, if it’s just a (syntactically legal) order mismatch.

I can't point to all the exact places in vscode where this happens, but from debugging, what I've seen happen is that vscode tries to match filterText to the content in the replacementSpan. So if the replacementSpan contains the wrong modifiers that you already typed, it won't match the filterText (that would be just the name of the property). e.g. if you already have protected override |, and the replacement span includes protected override, it won't match a property named foo whose completion filter text would be just foo with the change in this PR.

We could allow the wrong modifiers, or maybe just the wrong order, but if the restriction I described above is true and there's no way around it, then we can't fix the existing wrong modifiers.

@DanielRosenwasser
Copy link
Member

Sounds like an editor change that could be made? @mjbvz

@gabritto
Copy link
Member Author

@typescript-bot run DT

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 11, 2023

Heya @gabritto, I've started to run the parallelized Definitely Typed test suite on this PR at 2bdf846. You can monitor the build here.

let isSnippet: true | undefined;
let replacementSpan: TextSpan | undefined;
let insertText: string = name;
const filterText: string = name;
Copy link
Member

Choose a reason for hiding this comment

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

If filter text is name why cant editors use name itself to sort.. may need to considerkind along with that but it feels like we are returning same data.

Copy link
Member Author

Choose a reason for hiding this comment

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

The editor doesn't know that it should use name as the filterText, because in theory filterText could be anything. We could change the TS vscode extension to use the name as the filterText for class member snippet completions, but then that change would be restricted to vscode, and other editors would potentially run into the problem this PR is trying to fix.

@gabritto
Copy link
Member Author

Ok, so I tried making the class member completions fix the existing modifiers with a code action. It doesn't look good because of the delay in applying the code action after the completion is inserted, so I'm not going to pursue that approach.

So the options are, considering how vscode currently works with regards to filterText/replacementSpan, if the user has already typed some modifiers:

  • Only offer the completion if the already present modifiers match the modifiers the completion would insert (this is the current behavior of the PR).
  • Always offer the completion regardless of the present modifiers, and let the user fix them afterwards.

@gabritto gabritto requested review from andrewbranch and removed request for andrewbranch May 16, 2023 23:01
@gabritto
Copy link
Member Author

@typescript-bot test this
@typescript-bot run DT
@typescript-bot user test this
@typescript-bot user test tsserver
@typescript-bot test top100
@typescript-bot test tsserver top100
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 17, 2023

Heya @gabritto, I've started to run the perf test suite on this PR at cc95bfc. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 17, 2023

Heya @gabritto, I've started to run the extended test suite on this PR at cc95bfc. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 17, 2023

Heya @gabritto, I've started to run the diff-based user code test suite on this PR at cc95bfc. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 17, 2023

Heya @gabritto, I've started to run the diff-based top-repos suite (tsserver) on this PR at cc95bfc. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 17, 2023

Heya @gabritto, I've started to run the diff-based user code test suite (tsserver) on this PR at cc95bfc. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 17, 2023

Heya @gabritto, I've started to run the parallelized Definitely Typed test suite on this PR at cc95bfc. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 17, 2023

Heya @gabritto, I've started to run the diff-based top-repos suite on this PR at cc95bfc. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the user test suite comparing main and refs/pull/52525/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the user test suite comparing main and refs/pull/52525/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 1 instance of "Package install failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the top-repos suite comparing main and refs/pull/52525/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Hey @gabritto, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@gabritto
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 17, 2023

Heya @gabritto, I've started to run the perf test suite on this PR at cc95bfc. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the top-repos suite comparing main and refs/pull/52525/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@gabritto
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..52525
Metric main 52525 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 365,601k (± 0.01%) 365,597k (± 0.00%) ~ 365,577k 365,611k p=0.810 n=6
Parse Time 3.41s (± 0.63%) 3.42s (± 0.92%) ~ 3.39s 3.48s p=0.625 n=6
Bind Time 1.12s (± 0.36%) 1.11s (± 0.68%) ~ 1.10s 1.12s p=0.100 n=6
Check Time 8.76s (± 0.51%) 8.74s (± 0.29%) ~ 8.70s 8.77s p=0.568 n=6
Emit Time 7.47s (± 0.95%) 7.42s (± 0.30%) ~ 7.39s 7.44s p=0.163 n=6
Total Time 20.76s (± 0.49%) 20.69s (± 0.06%) ~ 20.68s 20.71s p=0.377 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 191,112k (± 0.01%) 191,153k (± 0.02%) ~ 191,108k 191,222k p=0.199 n=6
Parse Time 1.51s (± 1.06%) 1.51s (± 0.68%) ~ 1.49s 1.52s p=0.735 n=6
Bind Time 0.77s (± 0.67%) 0.77s (± 0.67%) ~ 0.76s 0.77s p=0.069 n=6
Check Time 9.49s (± 0.74%) 9.45s (± 0.35%) ~ 9.39s 9.47s p=0.228 n=6
Emit Time 2.73s (± 1.44%) 2.76s (± 1.64%) ~ 2.71s 2.82s p=0.572 n=6
Total Time 14.51s (± 0.41%) 14.48s (± 0.39%) ~ 14.40s 14.57s p=0.422 n=6
Monaco - node (v18.10.0, x64)
Memory used 346,612k (± 0.01%) 346,611k (± 0.01%) ~ 346,583k 346,653k p=0.810 n=6
Parse Time 2.59s (± 1.08%) 2.60s (± 0.80%) ~ 2.57s 2.63s p=0.517 n=6
Bind Time 1.00s (± 0.83%) 1.00s (± 0.00%) ~ 1.00s 1.00s p=0.176 n=6
Check Time 7.14s (± 0.64%) 7.11s (± 0.52%) ~ 7.06s 7.17s p=0.198 n=6
Emit Time 4.30s (± 1.27%) 4.24s (± 0.77%) -0.07s (- 1.55%) 4.20s 4.29s p=0.024 n=6
Total Time 15.04s (± 0.64%) 14.96s (± 0.31%) -0.09s (- 0.58%) 14.90s 15.04s p=0.043 n=6
TFS - node (v18.10.0, x64)
Memory used 300,606k (± 0.00%) 300,624k (± 0.00%) +18k (+ 0.01%) 300,608k 300,635k p=0.045 n=6
Parse Time 2.06s (± 1.18%) 2.05s (± 1.00%) ~ 2.03s 2.08s p=0.517 n=6
Bind Time 1.14s (± 0.55%) 1.14s (± 0.92%) ~ 1.12s 1.15s p=0.388 n=6
Check Time 6.62s (± 0.34%) 6.61s (± 0.65%) ~ 6.53s 6.66s p=0.572 n=6
Emit Time 3.85s (± 0.88%) 3.85s (± 0.51%) ~ 3.82s 3.87s p=0.747 n=6
Total Time 13.67s (± 0.33%) 13.64s (± 0.51%) ~ 13.52s 13.70s p=0.375 n=6
material-ui - node (v18.10.0, x64)
Memory used 481,676k (± 0.01%) 481,694k (± 0.01%) ~ 481,627k 481,740k p=0.336 n=6
Parse Time 3.10s (± 0.80%) 3.10s (± 0.75%) ~ 3.07s 3.13s p=0.871 n=6
Bind Time 0.92s (± 0.82%) 0.91s (± 1.79%) ~ 0.89s 0.93s p=0.741 n=6
Check Time 16.79s (± 0.18%) 16.77s (± 0.58%) ~ 16.68s 16.92s p=0.378 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.81s (± 0.13%) 20.79s (± 0.40%) ~ 20.70s 20.92s p=0.295 n=6
xstate - node (v18.10.0, x64)
Memory used 562,843k (± 0.01%) 562,873k (± 0.02%) ~ 562,684k 563,019k p=0.471 n=6
Parse Time 3.82s (± 0.66%) 3.82s (± 0.52%) ~ 3.80s 3.85s p=0.936 n=6
Bind Time 1.63s (± 0.67%) 1.64s (± 0.50%) ~ 1.63s 1.65s p=0.198 n=6
Check Time 2.81s (± 0.99%) 2.81s (± 0.95%) ~ 2.77s 2.84s p=0.807 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.35s (± 0.58%) 8.34s (± 0.27%) ~ 8.31s 8.36s p=1.000 n=6
Angular - node (v16.17.1, x64)
Memory used 365,043k (± 0.00%) 365,046k (± 0.01%) ~ 365,008k 365,071k p=0.689 n=6
Parse Time 3.55s (± 0.52%) 3.56s (± 0.46%) ~ 3.54s 3.58s p=0.548 n=6
Bind Time 1.18s (± 0.69%) 1.19s (± 0.69%) ~ 1.18s 1.20s p=0.666 n=6
Check Time 9.60s (± 0.44%) 9.56s (± 0.40%) ~ 9.48s 9.58s p=0.172 n=6
Emit Time 7.93s (± 0.93%) 7.89s (± 0.40%) ~ 7.84s 7.94s p=0.126 n=6
Total Time 22.27s (± 0.47%) 22.18s (± 0.34%) ~ 22.06s 22.29s p=0.148 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 192,916k (± 0.02%) 192,885k (± 0.02%) ~ 192,850k 192,952k p=0.173 n=6
Parse Time 1.58s (± 0.76%) 1.61s (± 1.07%) +0.02s (+ 1.58%) 1.58s 1.63s p=0.029 n=6
Bind Time 0.83s (± 0.49%) 0.83s (± 0.66%) ~ 0.82s 0.83s p=0.282 n=6
Check Time 10.25s (± 0.66%) 10.19s (± 0.60%) ~ 10.11s 10.28s p=0.196 n=6
Emit Time 3.01s (± 0.62%) 2.99s (± 0.69%) ~ 2.96s 3.01s p=0.463 n=6
Total Time 15.67s (± 0.52%) 15.62s (± 0.34%) ~ 15.54s 15.68s p=0.520 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,876k (± 0.00%) 345,873k (± 0.01%) ~ 345,829k 345,893k p=0.936 n=6
Parse Time 2.73s (± 0.49%) 2.74s (± 0.52%) ~ 2.72s 2.76s p=0.190 n=6
Bind Time 1.08s (± 0.95%) 1.09s (± 1.26%) ~ 1.07s 1.11s p=0.931 n=6
Check Time 7.81s (± 0.41%) 7.82s (± 0.43%) ~ 7.78s 7.88s p=0.462 n=6
Emit Time 4.49s (± 0.23%) 4.46s (± 0.51%) -0.02s (- 0.45%) 4.42s 4.48s p=0.046 n=6
Total Time 16.10s (± 0.23%) 16.11s (± 0.38%) ~ 16.04s 16.22s p=0.629 n=6
TFS - node (v16.17.1, x64)
Memory used 299,948k (± 0.01%) 299,946k (± 0.00%) ~ 299,925k 299,958k p=0.629 n=6
Parse Time 2.17s (± 0.57%) 2.16s (± 0.62%) ~ 2.14s 2.18s p=0.413 n=6
Bind Time 1.23s (± 0.66%) 1.22s (± 0.42%) -0.01s (- 0.81%) 1.22s 1.23s p=0.050 n=6
Check Time 7.27s (± 0.52%) 7.25s (± 0.63%) ~ 7.17s 7.29s p=0.628 n=6
Emit Time 4.35s (± 1.26%) 4.32s (± 0.54%) ~ 4.29s 4.35s p=0.228 n=6
Total Time 15.02s (± 0.57%) 14.95s (± 0.41%) ~ 14.86s 15.05s p=0.261 n=6
material-ui - node (v16.17.1, x64)
Memory used 480,949k (± 0.01%) 480,933k (± 0.01%) ~ 480,884k 480,967k p=0.471 n=6
Parse Time 3.25s (± 0.57%) 3.25s (± 0.32%) ~ 3.23s 3.26s p=0.806 n=6
Bind Time 0.94s (± 0.80%) 0.94s (± 0.67%) ~ 0.93s 0.95s p=0.718 n=6
Check Time 17.83s (± 0.50%) 17.88s (± 1.11%) ~ 17.73s 18.28s p=0.683 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.02s (± 0.39%) 22.07s (± 0.88%) ~ 21.91s 22.45s p=0.872 n=6
xstate - node (v16.17.1, x64)
Memory used 560,465k (± 0.02%) 560,546k (± 0.02%) ~ 560,405k 560,662k p=0.230 n=6
Parse Time 4.00s (± 0.35%) 4.01s (± 0.35%) ~ 3.99s 4.03s p=0.289 n=6
Bind Time 1.76s (± 0.36%) 1.75s (± 0.59%) ~ 1.74s 1.77s p=0.203 n=6
Check Time 3.06s (± 0.56%) 3.05s (± 0.53%) ~ 3.03s 3.07s p=0.569 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 4.62%) ~ 0.08s 0.09s p=0.405 n=6
Total Time 8.91s (± 0.24%) 8.91s (± 0.22%) ~ 8.89s 8.94s p=0.684 n=6
Angular - node (v14.21.3, x64)
Memory used 359,012k (± 0.01%) 359,032k (± 0.01%) ~ 358,993k 359,078k p=0.230 n=6
Parse Time 3.67s (± 0.14%) 3.68s (± 0.34%) +0.01s (+ 0.36%) 3.66s 3.70s p=0.037 n=6
Bind Time 1.22s (± 0.42%) 1.22s (± 0.00%) ~ 1.22s 1.22s p=0.174 n=6
Check Time 10.04s (± 0.60%) 9.98s (± 0.55%) ~ 9.91s 10.05s p=0.128 n=6
Emit Time 8.38s (± 0.57%) 8.29s (± 0.56%) -0.08s (- 0.99%) 8.22s 8.35s p=0.025 n=6
Total Time 23.30s (± 0.26%) 23.18s (± 0.20%) -0.12s (- 0.52%) 23.11s 23.25s p=0.008 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used 188,284k (± 0.02%) 188,269k (± 0.01%) ~ 188,248k 188,299k p=0.298 n=6
Parse Time 1.61s (± 0.51%) 1.60s (± 0.52%) ~ 1.60s 1.62s p=0.718 n=6
Bind Time 0.85s (± 0.48%) 0.85s (± 1.05%) ~ 0.84s 0.86s p=0.787 n=6
Check Time 10.32s (± 0.42%) 10.30s (± 0.53%) ~ 10.24s 10.38s p=0.466 n=6
Emit Time 3.11s (± 0.39%) 3.12s (± 0.85%) ~ 3.09s 3.16s p=0.867 n=6
Total Time 15.88s (± 0.31%) 15.88s (± 0.51%) ~ 15.79s 15.98s p=0.873 n=6
Monaco - node (v14.21.3, x64)
Memory used 341,035k (± 0.00%) 341,025k (± 0.00%) ~ 341,007k 341,049k p=0.296 n=6
Parse Time 2.80s (± 0.61%) 2.81s (± 0.73%) ~ 2.79s 2.85s p=0.366 n=6
Bind Time 1.10s (± 1.87%) 1.12s (± 0.46%) ~ 1.11s 1.12s p=0.276 n=6
Check Time 8.21s (± 0.56%) 8.18s (± 0.44%) ~ 8.15s 8.23s p=0.221 n=6
Emit Time 4.73s (± 0.63%) 4.69s (± 0.89%) ~ 4.65s 4.76s p=0.077 n=6
Total Time 16.85s (± 0.51%) 16.79s (± 0.16%) ~ 16.75s 16.83s p=0.630 n=6
TFS - node (v14.21.3, x64)
Memory used 295,134k (± 0.00%) 295,130k (± 0.00%) ~ 295,125k 295,137k p=0.229 n=6
Parse Time 2.38s (± 0.68%) 2.40s (± 0.51%) ~ 2.38s 2.41s p=0.241 n=6
Bind Time 1.06s (± 0.49%) 1.07s (± 0.76%) ~ 1.06s 1.08s p=0.523 n=6
Check Time 7.60s (± 0.39%) 7.56s (± 0.49%) ~ 7.52s 7.61s p=0.076 n=6
Emit Time 4.34s (± 0.93%) 4.30s (± 0.64%) -0.05s (- 1.07%) 4.27s 4.35s p=0.033 n=6
Total Time 15.39s (± 0.35%) 15.32s (± 0.41%) -0.07s (- 0.44%) 15.27s 15.44s p=0.030 n=6
material-ui - node (v14.21.3, x64)
Memory used 476,485k (± 0.00%) 476,527k (± 0.01%) ~ 476,444k 476,565k p=0.066 n=6
Parse Time 3.33s (± 0.35%) 3.34s (± 0.60%) ~ 3.31s 3.37s p=0.415 n=6
Bind Time 1.00s (± 0.63%) 1.00s (± 0.54%) ~ 1.00s 1.01s p=0.201 n=6
Check Time 18.81s (± 0.47%) 18.71s (± 0.17%) -0.10s (- 0.54%) 18.66s 18.75s p=0.036 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.15s (± 0.35%) 23.05s (± 0.14%) -0.09s (- 0.41%) 23.02s 23.11s p=0.020 n=6
xstate - node (v14.21.3, x64)
Memory used 549,431k (± 0.00%) 549,444k (± 0.00%) ~ 549,415k 549,471k p=0.378 n=6
Parse Time 4.25s (± 0.75%) 4.24s (± 0.66%) ~ 4.20s 4.28s p=0.572 n=6
Bind Time 1.59s (± 0.77%) 1.62s (± 2.57%) ~ 1.58s 1.69s p=0.288 n=6
Check Time 3.18s (± 0.92%) 3.19s (± 0.74%) ~ 3.16s 3.22s p=0.420 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 9.11s (± 0.39%) 9.14s (± 0.47%) ~ 9.10s 9.21s p=0.170 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.21.3, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.21.3, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.21.3, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.21.3, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.21.3, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.21.3, x64)
Benchmark Name Iterations
Current 52525 6
Baseline main 6

TSServer

Comparison Report - main..52525
Metric main 52525 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,534ms (± 0.30%) 2,539ms (± 0.37%) ~ 2,527ms 2,549ms p=0.334 n=6
Req 2 - geterr 5,571ms (± 0.47%) 5,530ms (± 0.34%) -41ms (- 0.73%) 5,507ms 5,559ms p=0.031 n=6
Req 3 - references 336ms (± 0.24%) 338ms (± 0.72%) ~ 335ms 341ms p=0.070 n=6
Req 4 - navto 286ms (± 0.54%) 287ms (± 0.48%) ~ 285ms 289ms p=0.800 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 85ms (± 1.16%) 85ms (± 0.89%) ~ 84ms 86ms p=1.000 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,656ms (± 0.61%) 2,640ms (± 0.68%) ~ 2,618ms 2,660ms p=0.230 n=6
Req 2 - geterr 4,287ms (± 0.63%) 4,284ms (± 0.46%) ~ 4,257ms 4,309ms p=0.688 n=6
Req 3 - references 349ms (± 0.81%) 349ms (± 0.46%) ~ 347ms 351ms p=1.000 n=6
Req 4 - navto 292ms (± 0.88%) 291ms (± 0.64%) ~ 288ms 293ms p=0.515 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 62ms (± 0.83%) 64ms (± 3.99%) ~ 62ms 69ms p=0.070 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,066ms (± 0.43%) 3,087ms (± 0.40%) +21ms (+ 0.69%) 3,074ms 3,106ms p=0.031 n=6
Req 2 - geterr 1,591ms (± 0.71%) 1,588ms (± 0.62%) ~ 1,571ms 1,599ms p=0.748 n=6
Req 3 - references 114ms (± 1.40%) 114ms (± 1.17%) ~ 112ms 116ms p=0.801 n=6
Req 4 - navto 366ms (± 0.45%) 363ms (± 0.21%) -2ms (- 0.64%) 362ms 364ms p=0.022 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 381ms (± 1.60%) 388ms (± 2.16%) ~ 375ms 399ms p=0.173 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,654ms (± 0.83%) 2,661ms (± 0.77%) ~ 2,638ms 2,697ms p=0.810 n=6
Req 2 - geterr 6,046ms (± 0.31%) 5,997ms (± 0.19%) -50ms (- 0.82%) 5,977ms 6,011ms p=0.005 n=6
Req 3 - references 351ms (± 0.53%) 353ms (± 0.53%) ~ 350ms 355ms p=0.416 n=6
Req 4 - navto 290ms (± 1.66%) 291ms (± 1.39%) ~ 287ms 295ms p=0.415 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 92ms (± 1.50%) 93ms (± 0.81%) ~ 92ms 94ms p=0.063 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,838ms (± 0.80%) 2,834ms (± 0.43%) ~ 2,819ms 2,854ms p=0.810 n=6
Req 2 - geterr 4,665ms (± 0.52%) 4,644ms (± 0.31%) ~ 4,624ms 4,662ms p=0.230 n=6
Req 3 - references 365ms (± 0.48%) 364ms (± 0.30%) ~ 362ms 365ms p=0.503 n=6
Req 4 - navto 288ms (± 0.92%) 289ms (± 0.18%) ~ 288ms 289ms p=0.437 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 68ms (± 0.76%) 68ms (± 1.55%) ~ 66ms 69ms p=0.794 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,213ms (± 0.53%) 3,218ms (± 0.40%) ~ 3,203ms 3,234ms p=0.748 n=6
Req 2 - geterr 1,741ms (± 0.79%) 1,749ms (± 1.35%) ~ 1,725ms 1,789ms p=0.575 n=6
Req 3 - references 129ms (± 8.75%) 124ms (± 0.33%) ~ 123ms 124ms p=0.405 n=6
Req 4 - navto 345ms (± 1.18%) 343ms (± 0.60%) ~ 340ms 346ms p=0.255 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 409ms (± 2.22%) 406ms (± 1.20%) ~ 401ms 411ms p=0.627 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,806ms (± 0.52%) 2,783ms (± 0.30%) -24ms (- 0.85%) 2,767ms 2,791ms p=0.045 n=6
Req 2 - geterr 6,238ms (± 0.68%) 6,154ms (± 0.36%) -84ms (- 1.35%) 6,123ms 6,184ms p=0.008 n=6
Req 3 - references 362ms (± 1.50%) 361ms (± 1.09%) ~ 356ms 366ms p=0.936 n=6
Req 4 - navto 291ms (± 0.49%) 290ms (± 1.06%) ~ 287ms 294ms p=0.872 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 96ms (± 6.10%) 95ms (± 8.28%) ~ 83ms 103ms p=0.747 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,969ms (± 0.51%) 2,961ms (± 0.14%) ~ 2,955ms 2,967ms p=0.295 n=6
Req 2 - geterr 4,560ms (± 1.81%) 4,508ms (± 0.38%) ~ 4,480ms 4,526ms p=0.128 n=6
Req 3 - references 375ms (± 0.28%) 375ms (± 0.55%) ~ 372ms 377ms p=1.000 n=6
Req 4 - navto 298ms (± 0.50%) 298ms (± 0.18%) ~ 297ms 298ms p=0.247 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 79ms (± 6.97%) 76ms (± 0.54%) ~ 76ms 77ms p=0.849 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 3,513ms (± 1.10%) 3,493ms (± 0.83%) ~ 3,466ms 3,547ms p=0.261 n=6
Req 2 - geterr 1,856ms (± 0.97%) 1,853ms (± 0.44%) ~ 1,839ms 1,861ms p=1.000 n=6
Req 3 - references 148ms (± 8.67%) 152ms (± 8.54%) ~ 135ms 165ms p=0.748 n=6
Req 4 - navto 395ms (± 1.55%) 401ms (± 2.39%) ~ 395ms 420ms p=0.377 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 428ms (± 1.46%) 435ms (± 0.28%) +8ms (+ 1.79%) 433ms 436ms p=0.009 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.21.3, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.21.3, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.21.3, x64)
Benchmark Name Iterations
Current 52525 6
Baseline main 6

Startup

Comparison Report - main..52525
Metric main 52525 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 144.30ms (± 0.33%) 141.52ms (± 0.16%) -2.79ms (- 1.93%) 140.91ms 144.00ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 220.61ms (± 0.28%) 220.72ms (± 0.16%) +0.11ms (+ 0.05%) 219.82ms 225.36ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 223.11ms (± 0.35%) 222.05ms (± 0.14%) -1.05ms (- 0.47%) 221.23ms 226.96ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 205.15ms (± 0.34%) 203.78ms (± 0.15%) -1.37ms (- 0.67%) 203.09ms 207.29ms p=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
Benchmark Name Iterations
Current 52525 6
Baseline main 6

Developer Information:

Download Benchmark

@gabritto gabritto merged commit 24ac9e7 into main May 17, 2023
@gabritto gabritto deleted the gabritto/issue52121 branch May 17, 2023 22:14
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Class member snippets should probably not have a lower priority than keywords

6 participants