Skip to content

Constraints for generic tuple types #53672

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 8 commits into from
May 2, 2023
Merged

Constraints for generic tuple types #53672

merged 8 commits into from
May 2, 2023

Conversation

ahejlsberg
Copy link
Member

@ahejlsberg ahejlsberg commented Apr 5, 2023

Fixes #53256.
Fixes #53563.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Apr 5, 2023
@ahejlsberg ahejlsberg requested a review from RyanCavanaugh April 5, 2023 15:12
@ahejlsberg
Copy link
Member Author

@typescript-bot test this
@typescript-bot user test this inline
@typescript-bot run dt
@typescript-bot perf test faster
@typescript-bot test top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 5, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 5, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 5, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 5, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 5, 2023

Heya @ahejlsberg, I've started to run the abridged perf test suite on this PR at 812b92f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

pmndrs/zustand

tsconfig.json

  • error TS2321: Excessive stack depth comparing types '"setState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/subscribeWithSelector", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"getState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/immer", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"setState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/immer", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"getState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/devtools", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"setState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/devtools", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"getState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/subscribeWithSelector", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"getState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/persist", unknown]]>'.
  • error TS2321: Excessive stack depth comparing types '"setState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/persist", unknown]]>'.

@typescript-bot
Copy link
Collaborator

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

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..53672

Metric main 53672 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 364,802k (± 0.01%) 364,814k (± 0.01%) ~ 364,776k 364,841k p=0.470 n=6
Parse Time 3.52s (± 0.43%) 3.55s (± 0.52%) ~ 3.53s 3.57s p=0.059 n=6
Bind Time 1.17s (± 0.71%) 1.18s (± 0.83%) ~ 1.17s 1.19s p=0.273 n=6
Check Time 9.56s (± 0.38%) 9.54s (± 0.47%) ~ 9.50s 9.62s p=0.333 n=6
Emit Time 7.97s (± 0.60%) 8.01s (± 0.88%) ~ 7.92s 8.09s p=0.422 n=6
Total Time 22.23s (± 0.15%) 22.27s (± 0.47%) ~ 22.13s 22.43s p=0.574 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 192,542k (± 0.02%) 193,149k (± 0.74%) ~ 192,534k 196,049k p=0.107 n=6
Parse Time 1.57s (± 1.36%) 1.60s (± 1.29%) ~ 1.56s 1.62s p=0.062 n=6
Bind Time 0.82s (± 0.66%) 0.82s (± 0.50%) ~ 0.81s 0.82s p=0.054 n=6
Check Time 10.34s (± 0.65%) 10.34s (± 0.39%) ~ 10.26s 10.38s p=0.469 n=6
Emit Time 3.01s (± 0.71%) 2.99s (± 1.25%) ~ 2.94s 3.03s p=0.466 n=6
Total Time 15.75s (± 0.44%) 15.74s (± 0.31%) ~ 15.68s 15.80s p=0.872 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,678k (± 0.00%) 345,674k (± 0.01%) ~ 345,641k 345,697k p=1.000 n=6
Parse Time 2.71s (± 0.20%) 2.72s (± 0.46%) +0.02s (+ 0.55%) 2.71s 2.74s p=0.025 n=6
Bind Time 1.08s (± 0.70%) 1.08s (± 0.38%) ~ 1.08s 1.09s p=1.000 n=6
Check Time 7.78s (± 0.68%) 7.76s (± 0.49%) ~ 7.72s 7.83s p=0.871 n=6
Emit Time 4.43s (± 0.84%) 4.46s (± 0.46%) ~ 4.43s 4.48s p=0.141 n=6
Total Time 16.00s (± 0.47%) 16.03s (± 0.36%) ~ 15.94s 16.12s p=0.374 n=6
TFS - node (v16.17.1, x64)
Memory used 300,058k (± 0.00%) 300,066k (± 0.01%) ~ 300,040k 300,100k p=0.470 n=6
Parse Time 2.15s (± 0.24%) 2.16s (± 0.41%) +0.01s (+ 0.62%) 2.15s 2.17s p=0.020 n=6
Bind Time 1.24s (± 0.68%) 1.24s (± 0.61%) ~ 1.23s 1.25s p=0.432 n=6
Check Time 7.22s (± 0.52%) 7.21s (± 0.33%) ~ 7.18s 7.25s p=0.678 n=6
Emit Time 4.33s (± 0.57%) 4.32s (± 0.68%) ~ 4.27s 4.36s p=0.514 n=6
Total Time 14.94s (± 0.27%) 14.93s (± 0.30%) ~ 14.88s 14.99s p=0.872 n=6
material-ui - node (v16.17.1, x64)
Memory used 479,419k (± 0.00%) 479,436k (± 0.01%) ~ 479,412k 479,481k p=0.378 n=6
Parse Time 3.24s (± 0.37%) 3.25s (± 0.57%) ~ 3.22s 3.27s p=0.324 n=6
Bind Time 0.95s (± 0.54%) 0.95s (± 0.43%) ~ 0.95s 0.96s p=0.595 n=6
Check Time 18.21s (± 0.31%) 18.18s (± 0.25%) ~ 18.14s 18.25s p=0.373 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.40s (± 0.26%) 22.38s (± 0.22%) ~ 22.33s 22.45s p=0.872 n=6
xstate - node (v16.17.1, x64)
Memory used 559,796k (± 0.03%) 559,700k (± 0.01%) ~ 559,567k 559,780k p=0.297 n=6
Parse Time 3.98s (± 0.26%) 3.98s (± 0.29%) ~ 3.97s 4.00s p=0.511 n=6
Bind Time 1.75s (± 0.70%) 1.74s (± 0.32%) ~ 1.73s 1.74s p=0.137 n=6
Check Time 3.06s (± 0.40%) 3.07s (± 0.44%) ~ 3.06s 3.10s p=0.324 n=6
Emit Time 0.09s (± 4.45%) 0.09s (± 4.45%) ~ 0.09s 0.10s p=1.000 n=6
Total Time 8.87s (± 0.28%) 8.89s (± 0.24%) ~ 8.86s 8.92s p=0.293 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 (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 53672 6
Baseline main 6

Developer Information:

Download Benchmark

@awerlogus
Copy link

@ahejlsberg will this PR fix also #53256?

@ahejlsberg
Copy link
Member Author

@awerlogus Yes, I'll make sure it does.

@ahejlsberg
Copy link
Member Author

@typescript-bot test this
@typescript-bot user test this inline
@typescript-bot run dt
@typescript-bot test top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 7, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 7, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 7, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 7, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

pmndrs/zustand

tsconfig.json

  • error TS2321: Excessive stack depth comparing types '"setState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/subscribeWithSelector", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"getState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/immer", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"setState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/immer", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"getState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/devtools", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"setState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/devtools", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"getState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/subscribeWithSelector", never]]>'.
  • error TS2321: Excessive stack depth comparing types '"getState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/persist", unknown]]>'.
  • error TS2321: Excessive stack depth comparing types '"setState"' and 'keyof Mutate<StoreApi<T>, [...Mps, ["zustand/persist", unknown]]>'.

@typescript-bot
Copy link
Collaborator

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

@awerlogus
Copy link

@ahejlsberg please take a look at these two examples which are also related to generic tuple types

// No error, but expected
const a = <T extends [unknown]>(x: T): T[0] => 123

// string type, but number value
const b = a([''])
declare const a: <T extends [unknown]>(x: T[0]) => void

// const a: <[unknown]>(x: unknown) => void
a('123')

// It would be nice if type of 0 element of T will be inferred from type of argument passed as x

@ahejlsberg
Copy link
Member Author

@typescript-bot test this
@typescript-bot user test this inline
@typescript-bot run dt
@typescript-bot perf test faster
@typescript-bot test top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 24, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 24, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 24, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 24, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 24, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..53672

Metric main 53672 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 365,228k (± 0.01%) 365,187k (± 0.01%) ~ 365,131k 365,239k p=0.173 n=6
Parse Time 3.54s (± 0.21%) 3.55s (± 0.66%) ~ 3.52s 3.58s p=0.164 n=6
Bind Time 1.18s (± 1.07%) 1.18s (± 0.88%) ~ 1.17s 1.19s p=0.560 n=6
Check Time 9.53s (± 0.50%) 9.55s (± 0.59%) ~ 9.49s 9.63s p=0.468 n=6
Emit Time 7.90s (± 0.29%) 7.89s (± 0.67%) ~ 7.84s 7.99s p=0.121 n=6
Total Time 22.14s (± 0.33%) 22.17s (± 0.29%) ~ 22.11s 22.25s p=0.421 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 192,643k (± 0.02%) 193,765k (± 0.89%) ~ 192,611k 196,208k p=0.336 n=6
Parse Time 1.59s (± 1.32%) 1.60s (± 1.23%) ~ 1.57s 1.63s p=0.139 n=6
Bind Time 0.83s (± 0.62%) 0.83s (± 0.91%) ~ 0.82s 0.84s p=0.784 n=6
Check Time 10.26s (± 0.41%) 10.28s (± 0.45%) ~ 10.23s 10.37s p=0.466 n=6
Emit Time 3.02s (± 1.18%) 3.03s (± 1.37%) ~ 3.00s 3.11s p=0.806 n=6
Total Time 15.70s (± 0.21%) 15.74s (± 0.26%) ~ 15.70s 15.81s p=0.063 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,785k (± 0.01%) 345,790k (± 0.00%) ~ 345,772k 345,816k p=1.000 n=6
Parse Time 2.72s (± 0.66%) 2.71s (± 0.38%) ~ 2.70s 2.73s p=0.566 n=6
Bind Time 1.09s (± 0.47%) 1.09s (± 0.75%) ~ 1.08s 1.10s p=0.929 n=6
Check Time 7.84s (± 0.32%) 7.86s (± 0.27%) ~ 7.83s 7.89s p=0.169 n=6
Emit Time 4.45s (± 0.80%) 4.45s (± 0.81%) ~ 4.39s 4.49s p=1.000 n=6
Total Time 16.10s (± 0.32%) 16.11s (± 0.27%) ~ 16.07s 16.17s p=1.000 n=6
TFS - node (v16.17.1, x64)
Memory used 300,049k (± 0.00%) 300,068k (± 0.01%) ~ 300,043k 300,093k p=0.229 n=6
Parse Time 2.16s (± 0.56%) 2.15s (± 0.70%) ~ 2.14s 2.18s p=0.621 n=6
Bind Time 1.24s (± 0.44%) 1.23s (± 0.89%) ~ 1.22s 1.25s p=0.227 n=6
Check Time 7.25s (± 0.31%) 7.24s (± 0.19%) ~ 7.22s 7.26s p=0.871 n=6
Emit Time 4.38s (± 0.91%) 4.39s (± 0.96%) ~ 4.36s 4.47s p=1.000 n=6
Total Time 15.02s (± 0.44%) 15.02s (± 0.42%) ~ 14.94s 15.13s p=0.873 n=6
material-ui - node (v16.17.1, x64)
Memory used 481,578k (± 0.01%) 481,621k (± 0.01%) ~ 481,571k 481,646k p=0.093 n=6
Parse Time 3.24s (± 0.17%) 3.24s (± 0.54%) ~ 3.22s 3.27s p=0.663 n=6
Bind Time 0.94s (± 0.55%) 0.94s (± 0.67%) ~ 0.93s 0.95s p=0.386 n=6
Check Time 17.78s (± 0.28%) 17.95s (± 0.77%) +0.17s (+ 0.95%) 17.79s 18.10s p=0.020 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.95s (± 0.24%) 22.13s (± 0.65%) +0.17s (+ 0.79%) 21.97s 22.31s p=0.015 n=6
xstate - node (v16.17.1, x64)
Memory used 560,570k (± 0.01%) 560,597k (± 0.03%) ~ 560,453k 560,752k p=0.873 n=6
Parse Time 3.98s (± 0.25%) 4.00s (± 0.19%) +0.02s (+ 0.50%) 3.99s 4.01s p=0.007 n=6
Bind Time 1.76s (± 0.31%) 1.77s (± 0.43%) ~ 1.76s 1.78s p=0.476 n=6
Check Time 3.06s (± 0.32%) 3.05s (± 0.68%) ~ 3.01s 3.07s p=0.157 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.89s (± 0.20%) 8.90s (± 0.28%) ~ 8.86s 8.93s p=0.373 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 (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 53672 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

Hey @ahejlsberg, it looks like the DT test run failed. Please check the log for more details.
You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Something interesting changed - please have a look.

Details

vercel/hyper

2 of 3 projects failed to build with the old tsc and were ignored

tsconfig.json

  • error TS2321: Excessive stack depth comparing types '[Head<_ReverseTail<ExtractParameters<T>>>, ReverseHead<ExtractParameters<T>> extends readonly unknown[] ? (readonly unknown[] & ReverseHead<...>)[number] : never]' and '[Head<_ReverseTail<ExtractParameters<T>>>, ...unknown[][]]'.
    • file:///mnt/ts_downloads/hyper/node_modules/reselect/es/versionedTypes/ts47-mergeParameters.d.ts#L16 in tsconfig.json
  • error TS2589: Type instantiation is excessively deep and possibly infinite.
    • file:///mnt/ts_downloads/hyper/node_modules/reselect/es/versionedTypes/ts47-mergeParameters.d.ts#L16 in tsconfig.json
    • file:///mnt/ts_downloads/hyper/node_modules/reselect/es/types.d.ts#L47 in tsconfig.json
  • error TS2321: Excessive stack depth comparing types '[Head<_ReverseTail<ExtractParameters<S>>>, ReverseHead<ExtractParameters<S>> extends readonly unknown[] ? (readonly unknown[] & ReverseHead<...>)[number] : never]' and '[Head<_ReverseTail<ExtractParameters<S>>>, ...unknown[][]]'.
    • file:///mnt/ts_downloads/hyper/node_modules/reselect/es/types.d.ts#L47 in tsconfig.json

@ahejlsberg
Copy link
Member Author

@typescript-bot test this
@typescript-bot user test this inline
@typescript-bot run dt
@typescript-bot perf test faster
@typescript-bot test top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 25, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 25, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 25, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 25, 2023

Heya @ahejlsberg, I've started to run the abridged perf test suite on this PR at 417f154. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 25, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..53672

Metric main 53672 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 365,211k (± 0.01%) 365,192k (± 0.00%) ~ 365,181k 365,212k p=0.126 n=6
Parse Time 3.54s (± 0.52%) 3.57s (± 0.41%) +0.03s (+ 0.85%) 3.55s 3.59s p=0.018 n=6
Bind Time 1.18s (± 0.44%) 1.18s (± 0.44%) ~ 1.17s 1.18s p=1.000 n=6
Check Time 9.56s (± 0.33%) 9.56s (± 0.62%) ~ 9.50s 9.63s p=0.872 n=6
Emit Time 7.92s (± 0.66%) 7.93s (± 0.89%) ~ 7.85s 8.03s p=0.936 n=6
Total Time 22.19s (± 0.21%) 22.24s (± 0.60%) ~ 22.09s 22.42s p=0.688 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,204k (± 0.66%) 192,716k (± 0.03%) ~ 192,646k 192,777k p=0.936 n=6
Parse Time 1.58s (± 1.42%) 1.59s (± 0.74%) ~ 1.57s 1.60s p=0.933 n=6
Bind Time 0.83s (± 0.66%) 0.82s (± 0.77%) ~ 0.81s 0.83s p=0.201 n=6
Check Time 10.21s (± 0.40%) 10.33s (± 0.36%) +0.12s (+ 1.19%) 10.27s 10.37s p=0.005 n=6
Emit Time 3.01s (± 0.64%) 3.02s (± 0.65%) ~ 3.00s 3.05s p=0.220 n=6
Total Time 15.63s (± 0.31%) 15.77s (± 0.31%) +0.14s (+ 0.90%) 15.70s 15.83s p=0.006 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,795k (± 0.00%) 345,783k (± 0.00%) ~ 345,762k 345,798k p=0.171 n=6
Parse Time 2.73s (± 0.51%) 2.71s (± 0.73%) ~ 2.69s 2.75s p=0.255 n=6
Bind Time 1.08s (± 0.50%) 1.09s (± 0.75%) ~ 1.08s 1.10s p=0.859 n=6
Check Time 7.82s (± 0.28%) 7.86s (± 0.59%) ~ 7.80s 7.92s p=0.172 n=6
Emit Time 4.46s (± 0.57%) 4.49s (± 1.06%) ~ 4.40s 4.54s p=0.145 n=6
Total Time 16.10s (± 0.23%) 16.15s (± 0.59%) ~ 16.00s 16.26s p=0.170 n=6
TFS - node (v16.17.1, x64)
Memory used 300,058k (± 0.01%) 300,065k (± 0.01%) ~ 300,034k 300,106k p=0.422 n=6
Parse Time 2.14s (± 0.76%) 2.15s (± 0.49%) ~ 2.13s 2.16s p=0.802 n=6
Bind Time 1.23s (± 0.89%) 1.24s (± 0.68%) ~ 1.22s 1.24s p=0.465 n=6
Check Time 7.23s (± 0.54%) 7.25s (± 0.35%) ~ 7.21s 7.28s p=0.195 n=6
Emit Time 4.34s (± 0.61%) 4.38s (± 0.37%) +0.04s (+ 0.92%) 4.36s 4.40s p=0.043 n=6
Total Time 14.94s (± 0.44%) 15.00s (± 0.24%) ~ 14.96s 15.06s p=0.147 n=6
material-ui - node (v16.17.1, x64)
Memory used 481,590k (± 0.01%) 481,534k (± 0.01%) -56k (- 0.01%) 481,496k 481,580k p=0.045 n=6
Parse Time 3.24s (± 0.34%) 3.25s (± 0.13%) ~ 3.25s 3.26s p=0.054 n=6
Bind Time 0.94s (± 0.67%) 0.94s (± 0.86%) ~ 0.93s 0.95s p=0.432 n=6
Check Time 17.84s (± 0.35%) 17.87s (± 0.63%) ~ 17.73s 18.00s p=0.573 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.32%) 22.06s (± 0.52%) ~ 21.91s 22.19s p=0.423 n=6
xstate - node (v16.17.1, x64)
Memory used 560,571k (± 0.02%) 560,583k (± 0.02%) ~ 560,477k 560,706k p=0.810 n=6
Parse Time 3.99s (± 0.34%) 3.99s (± 0.32%) ~ 3.98s 4.01s p=0.871 n=6
Bind Time 1.76s (± 0.31%) 1.77s (± 0.42%) ~ 1.76s 1.78s p=0.137 n=6
Check Time 3.04s (± 0.34%) 3.06s (± 0.38%) +0.02s (+ 0.49%) 3.05s 3.08s p=0.047 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.88s (± 0.15%) 8.91s (± 0.11%) +0.03s (+ 0.30%) 8.90s 8.92s p=0.007 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 (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 53672 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

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

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@ahejlsberg
Copy link
Member Author

Tests all look good and performance is unaffected (though some noise in the various runs). This one is ready to merge.

@ahejlsberg ahejlsberg merged commit 44f4e27 into main May 2, 2023
@ahejlsberg ahejlsberg deleted the fix53563 branch May 2, 2023 17:35
@jcalz
Copy link
Contributor

jcalz commented May 13, 2023

Is this a separate issue?

type NTuple<N extends number, A extends any[] = []> =
    A['length'] extends N ? A : NTuple<N, [any, ...A]>;

type X<N extends number> = `${[...NTuple<N>]['length']}`; // error
//                                           ^? (property) length: number
// Type '[...NTuple<N, []>]["length"]' is not assignable to type 
// 'string | number | bigint | boolean | null | undefined'.(2322)

Playground link

Seems related but maybe something about generic recursive tuple types makes this different? Comes from this SO question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
6 participants