Skip to content

Fixed array expression spreads into variadic const calls #52845

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

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Feb 18, 2023

I noticed the issue while working on another PR here:

declare function foo<const T extends readonly unknown[]>(...args: T): T;
foo(...[1, 'bar']); // should be OK
foo(true, ...[1, 'bar']); // OK

declare function foo2<T extends readonly unknown[]>(...args: T): T;
foo2(...[1, 'bar']); // OK
foo2(true, ...[1, 'bar']); // OK

declare function foo3<T extends unknown[]>(...args: T): T;
foo3(...[1, 'bar']); // OK
foo3(true, ...[1, 'bar']); // OK

TS playground

fixes #53149

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Feb 18, 2023
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@@ -12,4 +12,4 @@ f2(1);
f2(1, 2, 3);
f2(1, 2, 3, 4, 5);
f2(1, 2, 3, 4, 5, 6, 7);
f2(...[1], 2, 3, 4, 5, 6);
f2(1, 2, 3, 4, 5, ...[6, 7]);
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 changed this since the previous version became OK with this PR - spreading a fixed array expression into a call is now treated just as if positional arguments would be provided (thanks to getEffectiveCallArguments creating synthetic expressions)

@@ -29665,9 +29665,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const elementFlags: ElementFlags[] = [];
pushCachedContextualType(node);
const inDestructuringPattern = isAssignmentTarget(node);
const inConstContext = isConstContext(node);
const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent);
const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

initially, I wanted to adjust isConstContext - but spread arguments never have contextual types + asking for a contextual type of an argument calls getEffectiveCallArguments and we are within this call already, so it was creating an infinite loop

I was looking into other ways to check for the const context for such spread expressions but I couldn't figure out anything since I can't even check the signature (it's still resolvingSignature at this point).

@sandersn
Copy link
Member

sandersn commented Mar 7, 2023

@Andarist could you create a bug to track this as well? The problem itself seems pretty straightforward, but it would help us track bugs better.

@Andarist
Copy link
Contributor Author

Andarist commented Mar 7, 2023

@sandersn created #53149 for this issue

@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 8, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 8, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 8, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 8, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 8, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 8, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 8, 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/148751/artifacts?artifactName=tgz&fileId=5D2B715FC1004FC8A38CF36F7C497E0FAB129C486744F6EFF7E066B5A4555CD002&fileName=/typescript-5.1.0-insiders.20230308.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.1.0-pr-52845-10".;

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

microsoft/vscode

5 of 53 projects failed to build with the old tsc and were ignored

src/tsconfig.tsec.json

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.
There were interesting changes:

Branch only errors:

Package: lodash
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/lodash/lodash-tests.ts:729:9
ERROR: 729:9  expect  TypeScript@local expected type to be:
  never
got:
  AbcObject

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: inquirer
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/inquirer/inquirer-tests.ts:232:5
ERROR: 232:5  expect  TypeScript@local compile error: 
Unused '@ts-expect-error' directive.
ERROR: 234:9  expect  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(observerOrNext?: Partial<Observer<{ name: string; answer: any; }>> | ((value: { name: string; answer: any; }) => void) | undefined): Subscription', gave the following error.
    Type '(value: {    name_: string;    answer: number;}) => void' is not assignable to type '(value: { name: string; answer: any; }) => void'.
      Types of parameters 'value' and 'value' are incompatible.
        Property 'name_' is missing in type '{ name: string; answer: any; }' but required in type '{ name_: string; answer: number; }'.
  Overload 2 of 2, '(next?: ((value: { name: string; answer: any; }) => void) | null | undefined, error?: ((error: any) => void) | null | undefined, complete?: (() => void) | null | undefined): Subscription', gave the following error.
    Argument of type '{ next: (value: {    name_: string;    answer: number;}) => void; }' is not assignable to parameter of type '(value: { name: string; answer: any; }) => void'.
      Object literal may only specify known properties, and 'next' does not exist in type '(value: { name: string; answer: any; }) => void'.
ERROR: 260:5  expect  TypeScript@local compile error: 
Unused '@ts-expect-error' directive.
ERROR: 262:9  expect  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(observerOrNext?: Partial<Observer<QuestionAnswer<{ str: string; num: number; }>>> | ((value: QuestionAnswer<{ str: string; num: number; }>) => void) | undefined): Subscription', gave the following error.
    Type '(value: {    name: string;    answer: number;}) => void' is not assignable to type '(value: QuestionAnswer<{ str: string; num: number; }>) => void'.
      Types of parameters 'value' and 'value' are incompatible.
        Type 'QuestionAnswer<{ str: string; num: number; }>' is not assignable to type '{ name: string; answer: number; }'.
          Type '{ name: "str"; answer: string; }' is not assignable to type '{ name: string; answer: number; }'.
            Types of property 'answer' are incompatible.
              Type 'string' is not assignable to type 'number'.
  Overload 2 of 2, '(next?: ((value: QuestionAnswer<{ str: string; num: number; }>) => void) | null | undefined, error?: ((error: any) => void) | null | undefined, complete?: (() => void) | null | undefined): Subscription', gave the following error.
    Argument of type '{ next: (value: {    name: string;    answer: number;}) => void; }' is not assignable to parameter of type '(value: QuestionAnswer<{ str: string; num: number; }>) => void'.
      Object literal may only specify known properties, and 'next' does not exist in type '(value: QuestionAnswer<{ str: string; num: number; }>) => void'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: zen-observable
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/zen-observable/test/esm-tests.ts:37:9
ERROR: 37:9  expect  TypeScript@local expected type to be:
  number[]
got:
  [number]
ERROR: 81:9  expect  TypeScript@local expected type to be:
  number[]
got:
  [number]

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: inquirer/v8
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/inquirer/v8/inquirer-tests.ts:234:5
ERROR: 234:5  expect  TypeScript@local compile error: 
Unused '@ts-expect-error' directive.
ERROR: 236:9  expect  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(observerOrNext?: Partial<Observer<{ name: string; answer: any; }>> | ((value: { name: string; answer: any; }) => void) | undefined): Subscription', gave the following error.
    Type '(value: {    name_: string;    answer: number;}) => void' is not assignable to type '(value: { name: string; answer: any; }) => void'.
      Types of parameters 'value' and 'value' are incompatible.
        Property 'name_' is missing in type '{ name: string; answer: any; }' but required in type '{ name_: string; answer: number; }'.
  Overload 2 of 2, '(next?: ((value: { name: string; answer: any; }) => void) | null | undefined, error?: ((error: any) => void) | null | undefined, complete?: (() => void) | null | undefined): Subscription', gave the following error.
    Argument of type '{ next: (value: {    name_: string;    answer: number;}) => void; }' is not assignable to parameter of type '(value: { name: string; answer: any; }) => void'.
      Object literal may only specify known properties, and 'next' does not exist in type '(value: { name: string; answer: any; }) => void'.
ERROR: 262:5  expect  TypeScript@local compile error: 
Unused '@ts-expect-error' directive.
ERROR: 264:9  expect  TypeScript@local compile error: 
No overload matches this call.
  Overload 1 of 2, '(observerOrNext?: Partial<Observer<QuestionAnswer<{ str: string; num: number; }>>> | ((value: QuestionAnswer<{ str: string; num: number; }>) => void) | undefined): Subscription', gave the following error.
    Type '(value: {    name: string;    answer: number;}) => void' is not assignable to type '(value: QuestionAnswer<{ str: string; num: number; }>) => void'.
      Types of parameters 'value' and 'value' are incompatible.
        Type 'QuestionAnswer<{ str: string; num: number; }>' is not assignable to type '{ name: string; answer: number; }'.
          Type '{ name: "str"; answer: string; }' is not assignable to type '{ name: string; answer: number; }'.
            Types of property 'answer' are incompatible.
              Type 'string' is not assignable to type 'number'.
  Overload 2 of 2, '(next?: ((value: QuestionAnswer<{ str: string; num: number; }>) => void) | null | undefined, error?: ((error: any) => void) | null | undefined, complete?: (() => void) | null | undefined): Subscription', gave the following error.
    Argument of type '{ next: (value: {    name: string;    answer: number;}) => void; }' is not assignable to parameter of type '(value: QuestionAnswer<{ str: string; num: number; }>) => void'.
      Object literal may only specify known properties, and 'next' does not exist in type '(value: QuestionAnswer<{ str: string; num: number; }>) => void'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

You can check the log here.

@jakebailey
Copy link
Member

I have yet to look at the DT changes, but, that VS Code change actually seems correct given the definition of IAction?

@jakebailey
Copy link
Member

That inquirer change seems unrelated. @gabritto

@jakebailey
Copy link
Member

The lodash change seems like a actual improvement; I think it's now correctly applying the tuple to the overloads and now one of the arguments is actually typed properly as though it were called with two args.

The zen-observable change seems positive too.

@jakebailey
Copy link
Member

BTW here's a quick hover of the vscode example today, eek:

image

@jakebailey
Copy link
Member

Ignoring the spurious inquirer failure, this looks great to me.

@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Mar 8, 2023
@Andarist
Copy link
Contributor Author

Andarist commented Mar 8, 2023

Nice, added the IAction as a test case. Let me know if I should anyhow investigate the inquirer's case.

@jakebailey
Copy link
Member

Let me know if I should anyhow investigate the inquirer's case.

I don't think you need to; I've seen that exact failure on another PR, so it's probably a glitch in the diff.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..52845
Metric main 52845 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 359,838k (± 0.01%) 359,811k (± 0.01%) ~ 359,765k 359,860k p=0.229 n=6
Parse Time 3.50s (± 0.69%) 3.50s (± 0.84%) ~ 3.47s 3.55s p=0.686 n=6
Bind Time 1.13s (± 1.12%) 1.13s (± 1.03%) ~ 1.12s 1.15s p=1.000 n=6
Check Time 8.65s (± 0.49%) 8.67s (± 0.43%) ~ 8.62s 8.71s p=0.421 n=6
Emit Time 7.42s (± 0.86%) 7.44s (± 0.79%) ~ 7.38s 7.53s p=0.575 n=6
Total Time 20.70s (± 0.42%) 20.75s (± 0.51%) ~ 20.60s 20.90s p=0.471 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 194,540k (± 1.51%) 193,618k (± 1.60%) ~ 190,763k 196,509k p=0.689 n=6
Parse Time 1.48s (± 0.55%) 1.49s (± 0.71%) ~ 1.47s 1.50s p=0.181 n=6
Bind Time 0.77s (± 0.98%) 0.77s (± 0.98%) ~ 0.76s 0.78s p=1.000 n=6
Check Time 9.40s (± 1.06%) 9.37s (± 0.37%) ~ 9.33s 9.42s p=0.936 n=6
Emit Time 2.74s (± 0.68%) 2.73s (± 0.72%) ~ 2.72s 2.77s p=0.743 n=6
Total Time 14.38s (± 0.76%) 14.36s (± 0.32%) ~ 14.29s 14.40s p=0.936 n=6
Monaco - node (v18.10.0, x64)
Memory used 343,848k (± 0.01%) 343,835k (± 0.01%) ~ 343,809k 343,861k p=0.873 n=6
Parse Time 2.63s (± 0.72%) 2.64s (± 0.44%) ~ 2.63s 2.66s p=0.249 n=6
Bind Time 1.01s (± 1.02%) 1.02s (± 1.15%) ~ 1.01s 1.04s p=0.491 n=6
Check Time 7.01s (± 0.55%) 7.03s (± 0.54%) ~ 6.97s 7.07s p=0.420 n=6
Emit Time 4.19s (± 0.93%) 4.21s (± 0.84%) ~ 4.16s 4.25s p=0.462 n=6
Total Time 14.85s (± 0.46%) 14.90s (± 0.39%) ~ 14.78s 14.94s p=0.258 n=6
TFS - node (v18.10.0, x64)
Memory used 299,886k (± 0.01%) 299,881k (± 0.00%) ~ 299,864k 299,897k p=0.575 n=6
Parse Time 2.06s (± 0.71%) 2.05s (± 1.09%) ~ 2.02s 2.09s p=0.550 n=6
Bind Time 1.14s (± 0.78%) 1.14s (± 0.48%) ~ 1.14s 1.15s p=0.341 n=6
Check Time 6.50s (± 0.66%) 6.53s (± 0.55%) ~ 6.48s 6.58s p=0.332 n=6
Emit Time 3.87s (± 0.98%) 3.86s (± 0.72%) ~ 3.82s 3.89s p=1.000 n=6
Total Time 13.56s (± 0.63%) 13.58s (± 0.47%) ~ 13.49s 13.67s p=0.570 n=6
material-ui - node (v18.10.0, x64)
Memory used 476,447k (± 0.00%) 476,449k (± 0.00%) ~ 476,426k 476,479k p=1.000 n=6
Parse Time 3.13s (± 0.77%) 3.13s (± 0.69%) ~ 3.09s 3.15s p=0.871 n=6
Bind Time 0.92s (± 0.56%) 0.91s (± 1.08%) ~ 0.90s 0.93s p=0.191 n=6
Check Time 17.11s (± 0.41%) 17.13s (± 0.70%) ~ 16.98s 17.24s p=0.810 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.16s (± 0.38%) 21.16s (± 0.54%) ~ 21.01s 21.27s p=1.000 n=6
xstate - node (v18.10.0, x64)
Memory used 548,929k (± 0.02%) 549,011k (± 0.03%) ~ 548,800k 549,267k p=0.423 n=6
Parse Time 4.10s (± 0.58%) 4.08s (± 0.77%) ~ 4.03s 4.12s p=0.195 n=6
Bind Time 1.68s (± 0.62%) 1.67s (± 0.63%) ~ 1.66s 1.69s p=0.931 n=6
Check Time 2.79s (± 0.77%) 2.78s (± 0.75%) ~ 2.75s 2.80s p=0.376 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 4.99%) ~ 0.08s 0.09s p=0.405 n=6
Total Time 8.65s (± 0.38%) 8.61s (± 0.44%) ~ 8.57s 8.68s p=0.052 n=6
Angular - node (v16.17.1, x64)
Memory used 359,106k (± 0.01%) 359,093k (± 0.00%) ~ 359,083k 359,107k p=0.378 n=6
Parse Time 3.72s (± 0.50%) 3.71s (± 0.36%) ~ 3.69s 3.72s p=0.554 n=6
Bind Time 1.19s (± 0.43%) 1.19s (± 0.00%) ~ 1.19s 1.19s p=0.174 n=6
Check Time 9.45s (± 0.23%) 9.40s (± 0.63%) ~ 9.33s 9.50s p=0.077 n=6
Emit Time 7.93s (± 0.81%) 7.87s (± 0.30%) -0.06s (- 0.82%) 7.84s 7.91s p=0.020 n=6
Total Time 22.30s (± 0.44%) 22.17s (± 0.32%) -0.13s (- 0.58%) 22.06s 22.28s p=0.030 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 192,400k (± 0.02%) 192,941k (± 0.71%) ~ 192,336k 195,752k p=0.689 n=6
Parse Time 1.56s (± 0.63%) 1.57s (± 1.55%) ~ 1.52s 1.59s p=0.405 n=6
Bind Time 0.82s (± 0.77%) 0.82s (± 0.50%) ~ 0.82s 0.83s p=0.673 n=6
Check Time 10.16s (± 0.63%) 10.14s (± 0.77%) ~ 10.02s 10.25s p=0.468 n=6
Emit Time 2.98s (± 0.45%) 2.99s (± 0.83%) ~ 2.96s 3.03s p=0.560 n=6
Total Time 15.53s (± 0.45%) 15.52s (± 0.41%) ~ 15.44s 15.63s p=0.748 n=6
Monaco - node (v16.17.1, x64)
Memory used 343,127k (± 0.01%) 343,122k (± 0.01%) ~ 343,087k 343,189k p=0.630 n=6
Parse Time 2.80s (± 0.69%) 2.79s (± 0.49%) ~ 2.78s 2.81s p=0.459 n=6
Bind Time 1.08s (± 0.38%) 1.09s (± 1.27%) ~ 1.07s 1.11s p=0.924 n=6
Check Time 7.69s (± 0.46%) 7.70s (± 0.53%) ~ 7.63s 7.74s p=0.628 n=6
Emit Time 4.43s (± 0.62%) 4.43s (± 0.79%) ~ 4.40s 4.47s p=1.000 n=6
Total Time 16.00s (± 0.34%) 16.01s (± 0.45%) ~ 15.89s 16.11s p=0.467 n=6
TFS - node (v16.17.1, x64)
Memory used 299,238k (± 0.01%) 299,262k (± 0.01%) ~ 299,227k 299,285k p=0.128 n=6
Parse Time 2.17s (± 0.77%) 2.16s (± 0.59%) ~ 2.14s 2.17s p=0.558 n=6
Bind Time 1.24s (± 1.18%) 1.24s (± 1.97%) ~ 1.21s 1.27s p=1.000 n=6
Check Time 7.19s (± 0.43%) 7.18s (± 0.68%) ~ 7.11s 7.24s p=0.936 n=6
Emit Time 4.31s (± 0.23%) 4.35s (± 0.96%) ~ 4.28s 4.41s p=0.063 n=6
Total Time 14.91s (± 0.35%) 14.94s (± 0.53%) ~ 14.85s 15.07s p=0.748 n=6
material-ui - node (v16.17.1, x64)
Memory used 475,736k (± 0.02%) 475,706k (± 0.01%) ~ 475,680k 475,777k p=0.810 n=6
Parse Time 3.28s (± 0.47%) 3.29s (± 0.30%) ~ 3.28s 3.30s p=0.116 n=6
Bind Time 0.97s (± 0.53%) 0.96s (± 0.66%) ~ 0.95s 0.97s p=0.091 n=6
Check Time 18.19s (± 0.85%) 18.10s (± 0.49%) ~ 17.98s 18.23s p=0.470 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.44s (± 0.68%) 22.35s (± 0.40%) ~ 22.22s 22.48s p=0.470 n=6
xstate - node (v16.17.1, x64)
Memory used 546,579k (± 0.03%) 546,464k (± 0.01%) ~ 546,409k 546,571k p=0.128 n=6
Parse Time 4.26s (± 0.44%) 4.26s (± 0.58%) ~ 4.24s 4.31s p=0.934 n=6
Bind Time 1.76s (± 0.23%) 1.76s (± 0.66%) ~ 1.75s 1.78s p=0.242 n=6
Check Time 2.98s (± 0.46%) 2.99s (± 0.79%) ~ 2.96s 3.02s p=0.683 n=6
Emit Time 0.10s (± 5.34%) 0.09s (± 4.45%) ~ 0.09s 0.10s p=0.112 n=6
Total Time 9.10s (± 0.32%) 9.10s (± 0.48%) ~ 9.06s 9.18s p=0.569 n=6
Angular - node (v14.15.1, x64)
Memory used 352,871k (± 0.00%) 352,873k (± 0.01%) ~ 352,848k 352,907k p=1.000 n=6
Parse Time 3.72s (± 0.50%) 3.71s (± 0.93%) ~ 3.66s 3.76s p=0.294 n=6
Bind Time 1.26s (± 1.79%) 1.25s (± 0.60%) ~ 1.24s 1.26s p=0.734 n=6
Check Time 9.76s (± 0.61%) 9.78s (± 0.39%) ~ 9.75s 9.83s p=0.572 n=6
Emit Time 8.37s (± 0.63%) 8.36s (± 0.91%) ~ 8.23s 8.44s p=1.000 n=6
Total Time 23.11s (± 0.36%) 23.09s (± 0.32%) ~ 22.99s 23.19s p=1.000 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,666k (± 0.01%) 187,631k (± 0.02%) ~ 187,580k 187,677k p=0.108 n=6
Parse Time 1.58s (± 0.77%) 1.57s (± 0.26%) ~ 1.56s 1.57s p=0.209 n=6
Bind Time 0.84s (± 0.89%) 0.84s (± 0.75%) ~ 0.83s 0.85s p=0.718 n=6
Check Time 10.21s (± 0.39%) 10.22s (± 0.27%) ~ 10.19s 10.26s p=1.000 n=6
Emit Time 3.14s (± 0.53%) 3.13s (± 1.07%) ~ 3.10s 3.19s p=0.252 n=6
Total Time 15.76s (± 0.26%) 15.76s (± 0.27%) ~ 15.71s 15.82s p=0.806 n=6
Monaco - node (v14.15.1, x64)
Memory used 338,153k (± 0.01%) 338,146k (± 0.01%) ~ 338,121k 338,178k p=0.378 n=6
Parse Time 2.88s (± 0.41%) 2.87s (± 0.62%) ~ 2.84s 2.89s p=0.212 n=6
Bind Time 1.10s (± 1.06%) 1.10s (± 0.81%) ~ 1.09s 1.11s p=0.933 n=6
Check Time 8.12s (± 0.31%) 8.09s (± 0.26%) ~ 8.06s 8.11s p=0.075 n=6
Emit Time 4.68s (± 0.86%) 4.68s (± 0.48%) ~ 4.66s 4.71s p=0.466 n=6
Total Time 16.79s (± 0.28%) 16.74s (± 0.21%) ~ 16.68s 16.77s p=0.063 n=6
TFS - node (v14.15.1, x64)
Memory used 294,298k (± 0.00%) 294,296k (± 0.00%) ~ 294,278k 294,304k p=0.628 n=6
Parse Time 2.40s (± 0.69%) 2.37s (± 0.71%) -0.02s (- 1.04%) 2.35s 2.39s p=0.036 n=6
Bind Time 1.07s (± 0.38%) 1.06s (± 0.77%) ~ 1.06s 1.08s p=0.109 n=6
Check Time 7.51s (± 0.62%) 7.48s (± 0.35%) ~ 7.44s 7.51s p=0.198 n=6
Emit Time 4.30s (± 0.95%) 4.29s (± 1.22%) ~ 4.24s 4.39s p=0.568 n=6
Total Time 15.27s (± 0.43%) 15.21s (± 0.46%) ~ 15.13s 15.34s p=0.126 n=6
material-ui - node (v14.15.1, x64)
Memory used 471,376k (± 0.01%) 471,399k (± 0.00%) ~ 471,356k 471,422k p=0.230 n=6
Parse Time 3.46s (± 0.24%) 3.44s (± 0.47%) ~ 3.42s 3.46s p=0.198 n=6
Bind Time 1.01s (± 1.70%) 1.00s (± 1.03%) ~ 0.99s 1.02s p=0.410 n=6
Check Time 18.97s (± 0.80%) 18.94s (± 0.57%) ~ 18.84s 19.14s p=0.688 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.44s (± 0.69%) 23.39s (± 0.49%) ~ 23.27s 23.60s p=0.629 n=6
xstate - node (v14.15.1, x64)
Memory used 535,244k (± 0.01%) 535,215k (± 0.01%) ~ 535,154k 535,268k p=0.297 n=6
Parse Time 4.62s (± 0.42%) 4.61s (± 0.38%) ~ 4.59s 4.64s p=0.517 n=6
Bind Time 1.68s (± 0.79%) 1.67s (± 1.00%) ~ 1.65s 1.70s p=0.249 n=6
Check Time 3.18s (± 0.66%) 3.19s (± 0.65%) ~ 3.16s 3.21s p=0.466 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 9.57s (± 0.44%) 9.56s (± 0.26%) ~ 9.53s 9.60s p=0.748 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 52845 6
Baseline main 6

TSServer

Comparison Report - main..52845
Metric main 52845 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,367ms (± 0.59%) 2,386ms (± 0.58%) ~ 2,372ms 2,410ms p=0.065 n=6
Req 2 - geterr 5,343ms (± 0.73%) 5,376ms (± 0.71%) ~ 5,303ms 5,411ms p=0.173 n=6
Req 3 - references 327ms (± 0.84%) 328ms (± 1.38%) ~ 324ms 335ms p=0.872 n=6
Req 4 - navto 285ms (± 1.03%) 285ms (± 0.66%) ~ 282ms 287ms p=0.808 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 81ms (± 5.12%) 80ms (± 6.61%) ~ 74ms 90ms p=0.789 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,514ms (± 1.30%) 2,525ms (± 0.66%) ~ 2,501ms 2,551ms p=0.336 n=6
Req 2 - geterr 3,999ms (± 0.46%) 4,011ms (± 0.66%) ~ 3,979ms 4,053ms p=0.471 n=6
Req 3 - references 348ms (± 0.93%) 347ms (± 1.12%) ~ 342ms 352ms p=0.467 n=6
Req 4 - navto 294ms (± 0.56%) 293ms (± 0.63%) ~ 290ms 295ms p=0.803 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 72ms (± 4.84%) 75ms (± 1.09%) ~ 74ms 76ms p=0.284 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,183ms (± 0.55%) 3,171ms (± 0.48%) ~ 3,153ms 3,199ms p=0.297 n=6
Req 2 - geterr 1,605ms (± 1.32%) 1,606ms (± 1.10%) ~ 1,577ms 1,627ms p=1.000 n=6
Req 3 - references 105ms (± 2.00%) 104ms (± 1.61%) ~ 102ms 107ms p=0.463 n=6
Req 4 - navto 362ms (± 1.10%) 362ms (± 0.67%) ~ 358ms 364ms p=0.935 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 425ms (± 1.91%) 429ms (± 0.67%) ~ 425ms 433ms p=0.630 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,483ms (± 1.85%) 2,475ms (± 1.74%) ~ 2,425ms 2,529ms p=0.575 n=6
Req 2 - geterr 5,732ms (± 0.40%) 5,746ms (± 0.54%) ~ 5,710ms 5,779ms p=0.378 n=6
Req 3 - references 342ms (± 0.86%) 344ms (± 0.54%) ~ 340ms 345ms p=0.119 n=6
Req 4 - navto 278ms (± 1.65%) 277ms (± 1.23%) ~ 273ms 281ms p=0.685 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 (± 6.18%) 93ms (± 4.13%) ~ 87ms 97ms p=1.000 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,670ms (± 0.68%) 2,677ms (± 0.56%) ~ 2,660ms 2,701ms p=0.377 n=6
Req 2 - geterr 4,380ms (± 0.51%) 4,374ms (± 0.81%) ~ 4,325ms 4,435ms p=0.575 n=6
Req 3 - references 360ms (± 0.78%) 360ms (± 0.67%) ~ 356ms 363ms p=0.871 n=6
Req 4 - navto 291ms (± 0.68%) 289ms (± 0.36%) ~ 287ms 290ms p=0.058 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 74ms (± 3.60%) 73ms (± 2.05%) ~ 72ms 76ms p=0.934 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,357ms (± 0.54%) 3,334ms (± 0.47%) -23ms (- 0.68%) 3,317ms 3,358ms p=0.037 n=6
Req 2 - geterr 1,742ms (± 0.79%) 1,746ms (± 0.79%) ~ 1,729ms 1,769ms p=0.630 n=6
Req 3 - references 112ms (± 1.63%) 113ms (± 1.17%) ~ 112ms 115ms p=0.383 n=6
Req 4 - navto 349ms (± 1.30%) 348ms (± 0.90%) ~ 344ms 352ms p=0.623 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 435ms (± 0.95%) 435ms (± 0.37%) ~ 433ms 437ms p=0.627 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,570ms (± 0.61%) 2,574ms (± 0.57%) ~ 2,558ms 2,591ms p=0.872 n=6
Req 2 - geterr 6,104ms (± 0.54%) 6,076ms (± 0.34%) ~ 6,048ms 6,104ms p=0.147 n=6
Req 3 - references 356ms (± 0.46%) 359ms (± 0.38%) +2ms (+ 0.61%) 357ms 361ms p=0.046 n=6
Req 4 - navto 277ms (± 1.08%) 276ms (± 0.27%) ~ 275ms 277ms p=0.741 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 (± 4.24%) 102ms (± 0.40%) ~ 101ms 102ms p=0.445 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,805ms (± 1.03%) 2,816ms (± 0.51%) ~ 2,797ms 2,832ms p=0.630 n=6
Req 2 - geterr 4,539ms (± 2.42%) 4,492ms (± 1.90%) ~ 4,437ms 4,662ms p=0.378 n=6
Req 3 - references 378ms (± 4.91%) 388ms (± 6.78%) ~ 368ms 423ms p=0.419 n=6
Req 4 - navto 292ms (± 1.33%) 292ms (± 1.26%) ~ 287ms 295ms p=0.681 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 94ms (±10.27%) 95ms (± 7.87%) ~ 86ms 103ms p=0.746 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,658ms (± 0.17%) 3,649ms (± 0.65%) ~ 3,621ms 3,678ms p=0.810 n=6
Req 2 - geterr 1,849ms (± 0.83%) 1,854ms (± 0.80%) ~ 1,838ms 1,880ms p=0.873 n=6
Req 3 - references 128ms (± 2.17%) 129ms (± 2.54%) ~ 124ms 131ms p=0.933 n=6
Req 4 - navto 376ms (± 1.83%) 373ms (± 0.39%) ~ 371ms 375ms p=0.936 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 458ms (± 3.18%) 447ms (± 2.16%) ~ 439ms 464ms p=0.261 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 52845 6
Baseline main 6

Startup

Comparison Report - main..52845
Metric main 52845 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 141.55ms (± 0.26%) 141.06ms (± 0.15%) -0.49ms (- 0.35%) 140.44ms 143.18ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 226.90ms (± 0.17%) 225.86ms (± 0.15%) -1.04ms (- 0.46%) 224.96ms 230.08ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 228.67ms (± 0.16%) 228.05ms (± 0.22%) -0.61ms (- 0.27%) 226.88ms 235.90ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 209.37ms (± 0.16%) 208.74ms (± 0.16%) -0.63ms (- 0.30%) 207.88ms 215.26ms 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 52845 6
Baseline main 6

Developer Information:

Download Benchmark

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.

So, LGTM; these all feel like good changes. But, will need to update DT to reflect the improvement.

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.

Array expression can't be directly spread into rest-only signature with const modifier
4 participants