Skip to content

Fixed spreading iterables into arguments list directly into rest-only signatures #52838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 2, 2023

Conversation

Andarist
Copy link
Contributor

fixes #52781 , cc @RyanCavanaugh

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Feb 18, 2023
checkExpressionWithContextualType((arg as SpreadElement).expression, restType, context, checkMode);

if (isArrayLikeType(spreadType)) {
return getMutableArrayOrTupleType(spreadType);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

likely this shouldn't always produce mutable types but there are other bugs here, like this one:

declare function foo<const T extends readonly unknown[]>(...args: T): T;
const p = foo(...[1, 'bar']); // A spread argument must either have a tuple type or be passed to a rest parameter.(2556)
const p2 = foo(true, ...[1, 'bar']); // OK

I would prefer to fix this in a followup PR as the fix for this largely lies elsewhere - then I could revisit this piece of code to produce mutable/readonly array/tuple types based on inConstContext.

Sideways q - should T in the broken case be inferred as readonly (number | string)[] or should it be readonly [1, 'bar']? In other words - should the spread array expression inherit the const context?

Copy link
Member

Choose a reason for hiding this comment

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

Sideways q - should T in the broken case be inferred as readonly (number | string)[] or should it be readonly [1, 'bar']? In other words - should the spread array expression inherit the const context?

I think the latter?

Copy link
Member

Choose a reason for hiding this comment

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

The justification in my mind being that it should match what you get if you write foo(1, 'bar').

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also think that the latter is better but currently it's complicated to implement it. IIRC the easiest way to achieve this would be through getEffectiveCallArguments but it creates a cycle for spreads. getContextualTypeForArgument/getContextualTypeForArgumentAtIndex call back into getEffectiveCallArguments. I think that I've even seen a comment somewhere about spread arguments never needing the contextual type - so this would be the first time when that would actually have to become supported.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe I'm missing something, but is it possible to yank the required code out of getEffectiveCallArguments into a helper so that it's not directly used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, maybe. I can't say that I explored this in full yet. I might have also missed some additional things from my initial investigation, it's a little bit stale in my memory ;p

I could try to give this a shot in a followup PR unless you strongly think that it should go in together.

Copy link
Member

Choose a reason for hiding this comment

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

Unless I'm mistaken, your code sample behaves the same between main and this PR, so, I feel like it's fine to leave as-is and then report a bug for further refinement.

Copy link
Member

Choose a reason for hiding this comment

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

(But do tell me if I'm right or wrong here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless I'm mistaken, your code sample behaves the same between main and this PR,

Ye, the behavior is the same.

I feel like it's fine to leave as-is and then report a bug for further refinement.

It seems that I already started to work on further improvements related to this here (who could have guessed that? 😱 ) and I even mentioned some more details around that issue with getEffectiveCallArguments in the comment here

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see your memory is as stale as mine is on a regular basis

;(function(a, ...rest) {})('', true, ...itNum)

declare function fn1<const T extends readonly unknown[]>(...args: T): T;
const res1 = fn1(..."hello");
Copy link
Contributor Author

@Andarist Andarist Feb 18, 2023

Choose a reason for hiding this comment

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

I would also prefer to handle this in a follow-up PR - but one additional issue comes to mind here. Should this produce readonly string[] (like now) or should it actually be readonly ['h', 'e', 'l', 'l', 'o']? :P

The existing behavior is the current one, since in the case that works the readonly string[] gets inferred:

declare function foo<const T extends readonly unknown[]>(...args: T): T;
const p2 = foo(true, ...'hello');
//    ^? readonly [true, ...string[]]

Copy link
Member

Choose a reason for hiding this comment

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

It seems complicated to do that, so I'd probably say to start with the easier option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ye, I definitely want to start with the easier option (what is implemented today). Spreading into characters wouldn't have to be that complicated though since we could just expand the string into an array using JS itself:

[...'hello'].map(char => /* create string literal types */)

This solution has a nice advantage... it would work correctly with emojis 👨‍🎤

There is one potential problem with this though and I will touch on it in a different comment.

@@ -0,0 +1,22 @@
// @strict: true
// @noEmit: true
// @target: es5, esnext
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to be testing es5 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically to ensure you can't spread strings in es5 and that errors are expected to be reported for that. There is IterationUse.AllowsStringInputFlag that is used by for-of that allows strings to be iterated over in es5 for that purpose. I'm not sure why it's like that (and IIRC it's only allowed since es5 so it's not allowed in es3, I'm also not sure why that is. So overall, this just makes sure that this flag is not used in es5 context.

@jakebailey
Copy link
Member

@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot run dt
@typescript-bot perf test this
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 1, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 1, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 1, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 1, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 1, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 1, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 1, 2023

Hey @jakebailey, 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/147905/artifacts?artifactName=tgz&fileId=1B2C0EF65F0FD1F401F981958737B326A444767045A7F39FE02B53EA4C4EBCEA02&fileName=/typescript-5.1.0-insiders.20230301.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]".;

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

LGTM pending extended test results

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..52838
Metric main 52838 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 359,828k (± 0.01%) 359,789k (± 0.02%) ~ 359,694k 359,846k p=0.298 n=6
Parse Time 3.51s (± 0.59%) 3.49s (± 0.40%) ~ 3.47s 3.51s p=0.051 n=6
Bind Time 1.13s (± 0.67%) 1.13s (± 0.67%) ~ 1.12s 1.14s p=1.000 n=6
Check Time 8.64s (± 0.63%) 8.63s (± 0.35%) ~ 8.61s 8.69s p=0.808 n=6
Emit Time 7.44s (± 1.32%) 7.42s (± 0.67%) ~ 7.34s 7.47s p=1.000 n=6
Total Time 20.72s (± 0.66%) 20.66s (± 0.26%) ~ 20.58s 20.73s p=0.418 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 191,480k (± 1.47%) 190,530k (± 1.18%) ~ 189,518k 195,138k p=0.471 n=6
Parse Time 1.48s (± 0.66%) 1.48s (± 0.82%) ~ 1.46s 1.49s p=0.867 n=6
Bind Time 0.77s (± 0.67%) 0.76s (± 0.54%) ~ 0.76s 0.77s p=0.112 n=6
Check Time 9.28s (± 0.63%) 9.29s (± 0.27%) ~ 9.25s 9.32s p=0.572 n=6
Emit Time 2.73s (± 0.87%) 2.72s (± 0.64%) ~ 2.71s 2.75s p=0.682 n=6
Total Time 14.26s (± 0.45%) 14.26s (± 0.12%) ~ 14.24s 14.29s p=0.376 n=6
Monaco - node (v18.10.0, x64)
Memory used 343,894k (± 0.02%) 343,883k (± 0.02%) ~ 343,829k 344,011k p=0.689 n=6
Parse Time 2.64s (± 0.67%) 2.63s (± 0.86%) ~ 2.59s 2.65s p=0.622 n=6
Bind Time 1.01s (± 1.49%) 1.01s (± 0.75%) ~ 1.00s 1.02s p=0.933 n=6
Check Time 6.99s (± 0.67%) 7.01s (± 0.44%) ~ 6.98s 7.05s p=0.196 n=6
Emit Time 4.24s (± 0.87%) 4.21s (± 0.73%) ~ 4.17s 4.25s p=0.258 n=6
Total Time 14.87s (± 0.49%) 14.85s (± 0.39%) ~ 14.75s 14.93s p=1.000 n=6
TFS - node (v18.10.0, x64)
Memory used 299,899k (± 0.01%) 299,885k (± 0.01%) ~ 299,859k 299,906k p=0.173 n=6
Parse Time 2.03s (± 1.06%) 2.05s (± 1.14%) ~ 2.02s 2.07s p=0.285 n=6
Bind Time 1.14s (± 0.45%) 1.14s (± 0.00%) ~ 1.14s 1.14s p=0.174 n=6
Check Time 6.50s (± 0.52%) 6.49s (± 0.32%) ~ 6.46s 6.51s p=0.256 n=6
Emit Time 3.84s (± 1.22%) 3.84s (± 0.77%) ~ 3.81s 3.89s p=0.687 n=6
Total Time 13.51s (± 0.43%) 13.51s (± 0.33%) ~ 13.45s 13.56s p=1.000 n=6
material-ui - node (v18.10.0, x64)
Memory used 476,429k (± 0.01%) 476,385k (± 0.00%) ~ 476,370k 476,400k p=0.065 n=6
Parse Time 3.12s (± 0.31%) 3.11s (± 0.69%) ~ 3.07s 3.13s p=0.452 n=6
Bind Time 0.91s (± 0.83%) 0.91s (± 0.00%) ~ 0.91s 0.91s p=0.598 n=6
Check Time 17.01s (± 0.45%) 17.04s (± 0.35%) ~ 16.99s 17.13s p=0.687 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.05s (± 0.34%) 21.07s (± 0.27%) ~ 21.02s 21.16s p=0.687 n=6
xstate - node (v18.10.0, x64)
Memory used 548,302k (± 0.01%) 548,128k (± 0.03%) ~ 547,889k 548,374k p=0.128 n=6
Parse Time 4.08s (± 0.46%) 4.07s (± 0.69%) ~ 4.06s 4.13s p=0.290 n=6
Bind Time 1.66s (± 1.12%) 1.67s (± 0.82%) ~ 1.65s 1.69s p=1.000 n=6
Check Time 2.77s (± 0.66%) 2.76s (± 0.71%) ~ 2.73s 2.79s p=0.285 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 4.99%) ~ 0.08s 0.09s p=0.405 n=6
Total Time 8.59s (± 0.62%) 8.58s (± 0.29%) ~ 8.55s 8.62s p=0.521 n=6
Angular - node (v16.17.1, x64)
Memory used 359,097k (± 0.01%) 359,074k (± 0.01%) ~ 359,053k 359,096k p=0.173 n=6
Parse Time 3.71s (± 0.46%) 3.71s (± 0.22%) ~ 3.70s 3.72s p=0.677 n=6
Bind Time 1.19s (± 0.75%) 1.19s (± 0.34%) ~ 1.19s 1.20s p=0.787 n=6
Check Time 9.45s (± 0.49%) 9.40s (± 0.30%) ~ 9.35s 9.43s p=0.062 n=6
Emit Time 7.88s (± 0.86%) 7.87s (± 0.49%) ~ 7.81s 7.92s p=0.627 n=6
Total Time 22.24s (± 0.28%) 22.17s (± 0.29%) ~ 22.07s 22.25s p=0.090 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 191,302k (± 0.02%) 191,786k (± 0.69%) ~ 191,214k 194,485k p=0.298 n=6
Parse Time 1.57s (± 0.99%) 1.56s (± 1.07%) ~ 1.53s 1.58s p=0.491 n=6
Bind Time 0.82s (± 0.63%) 0.82s (± 0.63%) ~ 0.81s 0.82s p=0.069 n=6
Check Time 10.07s (± 0.55%) 10.10s (± 0.80%) ~ 9.98s 10.20s p=0.686 n=6
Emit Time 2.99s (± 0.59%) 3.01s (± 0.50%) +0.03s (+ 0.89%) 2.99s 3.03s p=0.040 n=6
Total Time 15.45s (± 0.40%) 15.49s (± 0.63%) ~ 15.32s 15.59s p=0.294 n=6
Monaco - node (v16.17.1, x64)
Memory used 343,154k (± 0.01%) 343,131k (± 0.01%) ~ 343,105k 343,179k p=0.128 n=6
Parse Time 2.81s (± 1.25%) 2.79s (± 1.23%) ~ 2.76s 2.84s p=0.517 n=6
Bind Time 1.08s (± 0.38%) 1.08s (± 0.70%) ~ 1.07s 1.09s p=1.000 n=6
Check Time 7.69s (± 0.51%) 7.67s (± 0.26%) ~ 7.65s 7.70s p=0.517 n=6
Emit Time 4.44s (± 0.44%) 4.43s (± 0.72%) ~ 4.38s 4.47s p=0.618 n=6
Total Time 16.02s (± 0.49%) 15.97s (± 0.35%) ~ 15.88s 16.04s p=0.295 n=6
TFS - node (v16.17.1, x64)
Memory used 299,265k (± 0.01%) 299,245k (± 0.01%) ~ 299,214k 299,267k p=0.228 n=6
Parse Time 2.16s (± 0.74%) 2.15s (± 1.12%) ~ 2.12s 2.18s p=0.934 n=6
Bind Time 1.24s (± 0.61%) 1.24s (± 0.79%) ~ 1.23s 1.25s p=1.000 n=6
Check Time 7.16s (± 0.42%) 7.15s (± 0.26%) ~ 7.13s 7.18s p=0.415 n=6
Emit Time 4.37s (± 0.95%) 4.34s (± 0.56%) ~ 4.32s 4.39s p=0.372 n=6
Total Time 14.94s (± 0.41%) 14.88s (± 0.31%) ~ 14.81s 14.95s p=0.198 n=6
material-ui - node (v16.17.1, x64)
Memory used 475,674k (± 0.00%) 475,650k (± 0.00%) -24k (- 0.01%) 475,624k 475,669k p=0.045 n=6
Parse Time 3.28s (± 0.31%) 3.28s (± 0.19%) ~ 3.27s 3.29s p=0.654 n=6
Bind Time 0.96s (± 0.00%) 0.96s (± 0.00%) ~ 0.96s 0.96s p=1.000 n=6
Check Time 18.01s (± 0.32%) 18.00s (± 0.22%) ~ 17.95s 18.04s p=0.748 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.25s (± 0.28%) 22.24s (± 0.17%) ~ 22.20s 22.28s p=0.747 n=6
xstate - node (v16.17.1, x64)
Memory used 545,957k (± 0.02%) 545,667k (± 0.02%) -291k (- 0.05%) 545,546k 545,911k p=0.013 n=6
Parse Time 4.26s (± 0.55%) 4.27s (± 0.18%) ~ 4.26s 4.28s p=1.000 n=6
Bind Time 1.76s (± 0.31%) 1.76s (± 0.46%) ~ 1.75s 1.77s p=0.088 n=6
Check Time 2.98s (± 0.66%) 2.98s (± 0.41%) ~ 2.97s 3.00s p=0.570 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 9.10s (± 0.28%) 9.10s (± 0.15%) ~ 9.08s 9.12s p=0.466 n=6
Angular - node (v14.15.1, x64)
Memory used 352,858k (± 0.00%) 352,803k (± 0.00%) -56k (- 0.02%) 352,793k 352,810k p=0.005 n=6
Parse Time 3.69s (± 0.47%) 3.70s (± 0.36%) ~ 3.68s 3.72s p=0.251 n=6
Bind Time 1.24s (± 0.51%) 1.24s (± 0.33%) ~ 1.24s 1.25s p=0.673 n=6
Check Time 9.69s (± 0.36%) 9.66s (± 0.46%) ~ 9.61s 9.74s p=0.289 n=6
Emit Time 8.27s (± 0.52%) 8.32s (± 0.43%) ~ 8.28s 8.37s p=0.077 n=6
Total Time 22.89s (± 0.26%) 22.93s (± 0.17%) ~ 22.85s 22.96s p=0.333 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used 186,551k (± 0.02%) 186,543k (± 0.01%) ~ 186,528k 186,564k p=0.936 n=6
Parse Time 1.57s (± 0.52%) 1.57s (± 0.40%) ~ 1.56s 1.58s p=0.432 n=6
Bind Time 0.85s (± 0.96%) 0.84s (± 0.90%) ~ 0.83s 0.85s p=0.120 n=6
Check Time 10.18s (± 0.30%) 10.12s (± 0.67%) ~ 10.04s 10.21s p=0.172 n=6
Emit Time 3.12s (± 0.56%) 3.12s (± 0.35%) ~ 3.11s 3.14s p=0.803 n=6
Total Time 15.71s (± 0.31%) 15.65s (± 0.49%) ~ 15.55s 15.74s p=0.172 n=6
Monaco - node (v14.15.1, x64)
Memory used 338,146k (± 0.01%) 338,130k (± 0.01%) ~ 338,107k 338,155k p=0.422 n=6
Parse Time 2.88s (± 0.75%) 2.87s (± 0.42%) ~ 2.85s 2.88s p=0.463 n=6
Bind Time 1.10s (± 0.37%) 1.10s (± 0.57%) ~ 1.09s 1.11s p=0.673 n=6
Check Time 8.08s (± 0.50%) 8.09s (± 0.37%) ~ 8.06s 8.13s p=0.466 n=6
Emit Time 4.68s (± 0.74%) 4.67s (± 0.88%) ~ 4.63s 4.72s p=1.000 n=6
Total Time 16.74s (± 0.39%) 16.73s (± 0.45%) ~ 16.63s 16.84s p=0.872 n=6
TFS - node (v14.15.1, x64)
Memory used 294,297k (± 0.00%) 294,285k (± 0.00%) ~ 294,263k 294,304k p=0.128 n=6
Parse Time 2.38s (± 0.74%) 2.38s (± 0.83%) ~ 2.36s 2.40s p=0.451 n=6
Bind Time 1.07s (± 0.76%) 1.07s (± 0.59%) ~ 1.06s 1.08s p=0.432 n=6
Check Time 7.49s (± 0.44%) 7.46s (± 0.68%) ~ 7.40s 7.55s p=0.171 n=6
Emit Time 4.29s (± 0.61%) 4.30s (± 1.02%) ~ 4.23s 4.35s p=0.573 n=6
Total Time 15.23s (± 0.38%) 15.21s (± 0.41%) ~ 15.10s 15.28s p=0.629 n=6
material-ui - node (v14.15.1, x64)
Memory used 471,382k (± 0.00%) 471,329k (± 0.01%) -53k (- 0.01%) 471,294k 471,387k p=0.031 n=6
Parse Time 3.45s (± 0.45%) 3.44s (± 0.34%) ~ 3.42s 3.45s p=0.271 n=6
Bind Time 1.00s (± 0.89%) 1.00s (± 1.37%) ~ 0.99s 1.02s p=0.562 n=6
Check Time 18.93s (± 0.30%) 18.93s (± 0.62%) ~ 18.81s 19.15s p=0.809 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.38s (± 0.25%) 23.38s (± 0.48%) ~ 23.26s 23.58s p=0.630 n=6
xstate - node (v14.15.1, x64)
Memory used 534,604k (± 0.01%) 534,368k (± 0.00%) -236k (- 0.04%) 534,348k 534,379k p=0.005 n=6
Parse Time 4.58s (± 1.21%) 4.50s (± 1.33%) -0.08s (- 1.67%) 4.41s 4.55s p=0.030 n=6
Bind Time 1.69s (± 2.96%) 1.70s (± 3.63%) ~ 1.65s 1.79s p=0.869 n=6
Check Time 3.12s (± 0.74%) 3.12s (± 0.41%) ~ 3.10s 3.13s p=1.000 n=6
Emit Time 0.10s (± 5.34%) 0.10s (± 0.00%) ~ 0.10s 0.10s p=0.174 n=6
Total Time 9.49s (± 0.42%) 9.43s (± 0.16%) -0.06s (- 0.67%) 9.40s 9.44s p=0.005 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 52838 6
Baseline main 6

TSServer

Comparison Report - main..52838
Metric main 52838 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,357ms (± 0.26%) 2,358ms (± 0.29%) ~ 2,350ms 2,368ms p=0.872 n=6
Req 2 - geterr 5,312ms (± 0.90%) 5,315ms (± 0.25%) ~ 5,300ms 5,337ms p=0.575 n=6
Req 3 - references 325ms (± 0.47%) 335ms (± 1.06%) +11ms (+ 3.29%) 332ms 342ms p=0.005 n=6
Req 4 - navto 285ms (± 0.14%) 284ms (± 0.41%) -1ms (- 0.47%) 282ms 285ms p=0.025 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 79ms (± 0.80%) 77ms (± 4.38%) -2ms (- 2.74%) 70ms 79ms p=0.031 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,515ms (± 0.86%) 2,501ms (± 0.72%) ~ 2,472ms 2,518ms p=0.471 n=6
Req 2 - geterr 4,008ms (± 0.50%) 3,974ms (± 0.90%) ~ 3,946ms 4,041ms p=0.093 n=6
Req 3 - references 347ms (± 0.67%) 352ms (± 0.39%) +4ms (+ 1.25%) 350ms 353ms p=0.011 n=6
Req 4 - navto 292ms (± 0.18%) 291ms (± 0.42%) ~ 290ms 293ms p=0.666 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.81%) 69ms (± 4.44%) ~ 67ms 75ms p=0.476 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,166ms (± 0.58%) 3,161ms (± 0.59%) ~ 3,129ms 3,180ms p=0.936 n=6
Req 2 - geterr 1,614ms (± 0.82%) 1,607ms (± 0.54%) ~ 1,594ms 1,613ms p=0.421 n=6
Req 3 - references 104ms (± 1.56%) 104ms (± 2.17%) ~ 102ms 108ms p=0.415 n=6
Req 4 - navto 358ms (± 0.42%) 359ms (± 2.05%) ~ 355ms 374ms p=0.291 n=6
Req 5 - completionInfo count 3,136 (± 0.00%) 3,136 (± 0.00%) ~ 3,136 3,136 p=1.000 n=6
Req 5 - completionInfo 430ms (± 0.75%) 422ms (± 1.63%) ~ 414ms 430ms p=0.106 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,480ms (± 1.74%) 2,483ms (± 2.07%) ~ 2,442ms 2,552ms p=1.000 n=6
Req 2 - geterr 5,705ms (± 0.61%) 5,664ms (± 0.55%) ~ 5,633ms 5,707ms p=0.093 n=6
Req 3 - references 339ms (± 0.90%) 348ms (± 0.74%) +9ms (+ 2.65%) 346ms 353ms p=0.005 n=6
Req 4 - navto 278ms (± 0.92%) 279ms (± 0.37%) ~ 278ms 281ms p=0.803 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 89ms (± 6.73%) 86ms (± 5.28%) ~ 83ms 95ms p=0.101 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,671ms (± 0.27%) 2,676ms (± 0.51%) ~ 2,654ms 2,696ms p=0.422 n=6
Req 2 - geterr 4,348ms (± 0.38%) 4,352ms (± 0.50%) ~ 4,326ms 4,388ms p=1.000 n=6
Req 3 - references 357ms (± 0.49%) 363ms (± 0.72%) +6ms (+ 1.59%) 360ms 367ms p=0.006 n=6
Req 4 - navto 287ms (± 0.89%) 289ms (± 1.01%) ~ 283ms 291ms p=0.164 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 77ms (± 4.11%) 73ms (± 1.03%) ~ 72ms 74ms p=0.099 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,332ms (± 0.35%) 3,339ms (± 0.19%) ~ 3,327ms 3,346ms p=0.173 n=6
Req 2 - geterr 1,820ms (± 3.92%) 1,761ms (± 1.13%) 🟩-59ms (- 3.26%) 1,740ms 1,797ms p=0.045 n=6
Req 3 - references 110ms (± 2.19%) 112ms (± 2.17%) ~ 107ms 113ms p=0.243 n=6
Req 4 - navto 343ms (± 1.24%) 343ms (± 1.16%) ~ 339ms 348ms p=1.000 n=6
Req 5 - completionInfo count 3,136 (± 0.00%) 3,136 (± 0.00%) ~ 3,136 3,136 p=1.000 n=6
Req 5 - completionInfo 437ms (± 0.93%) 433ms (± 0.81%) ~ 427ms 436ms p=0.126 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,568ms (± 0.22%) 2,562ms (± 0.73%) ~ 2,540ms 2,593ms p=0.298 n=6
Req 2 - geterr 6,023ms (± 0.67%) 6,029ms (± 0.49%) ~ 5,981ms 6,063ms p=0.810 n=6
Req 3 - references 358ms (± 0.35%) 365ms (± 0.47%) +7ms (+ 1.91%) 362ms 367ms p=0.005 n=6
Req 4 - navto 277ms (± 1.82%) 275ms (± 0.42%) ~ 273ms 276ms p=0.804 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 101ms (± 2.32%) 100ms (± 1.96%) ~ 97ms 103ms p=0.459 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,811ms (± 0.44%) 2,802ms (± 0.33%) ~ 2,790ms 2,816ms p=0.149 n=6
Req 2 - geterr 4,435ms (± 2.04%) 4,498ms (± 2.49%) ~ 4,387ms 4,607ms p=0.689 n=6
Req 3 - references 369ms (± 0.57%) 380ms (± 0.79%) +11ms (+ 2.89%) 376ms 383ms p=0.005 n=6
Req 4 - navto 295ms (± 0.89%) 292ms (± 1.25%) ~ 288ms 297ms p=0.144 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 88ms (± 8.81%) 89ms (±11.52%) ~ 81ms 102ms p=0.418 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,641ms (± 0.50%) 3,630ms (± 0.56%) ~ 3,591ms 3,648ms p=0.375 n=6
Req 2 - geterr 1,838ms (± 0.79%) 1,838ms (± 1.00%) ~ 1,810ms 1,865ms p=1.000 n=6
Req 3 - references 130ms (± 3.17%) 130ms (± 1.78%) ~ 126ms 133ms p=1.000 n=6
Req 4 - navto 375ms (± 0.86%) 375ms (± 0.57%) ~ 372ms 377ms p=0.571 n=6
Req 5 - completionInfo count 3,136 (± 0.00%) 3,136 (± 0.00%) ~ 3,136 3,136 p=1.000 n=6
Req 5 - completionInfo 449ms (± 2.23%) 455ms (± 3.67%) ~ 435ms 472ms p=0.630 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 52838 6
Baseline main 6

Startup

Comparison Report - main..52838
Metric main 52838 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 142.75ms (± 0.16%) 142.19ms (± 0.17%) -0.56ms (- 0.39%) 141.49ms 144.89ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 228.52ms (± 0.27%) 226.10ms (± 0.19%) -2.43ms (- 1.06%) 225.08ms 233.73ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 230.25ms (± 0.30%) 227.90ms (± 0.15%) -2.35ms (- 1.02%) 226.93ms 233.06ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 211.08ms (± 0.27%) 208.75ms (± 0.17%) -2.33ms (- 1.10%) 207.90ms 213.92ms p=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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 52838 6
Baseline main 6

Developer Information:

Download Benchmark

@chriskrycho

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Unexpected any[] spreading string into unknown[]-constrained argument position
4 participants