Skip to content
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

Allow non-generic return types to be read from single generic call signatures #54477

Merged

Conversation

Andarist
Copy link
Contributor

This PR permits circular references in some return types of generic call signatures - something that is already allowed in non-generic call signatures.

If the return type doesn't depend on type variables then the same thing can be allowed for it (including cases with instantiated return types not depending on type variables).

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 31, 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.

@@ -0,0 +1,53 @@
// @strict: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

test case reduced from https://github.com/Thinkmill/graphql-ts

interestingly, this one also depends on a quite recent change from #53246

Comment on lines +7 to +11
declare function fn2<T>(): (cb: () => any) => (a: T) => void;
const res2 = fn2()(() => res2);

declare function fn3<T>(): <T2>(cb: (arg: T2) => any) => (a: T) => void;
const res3 = fn3()(() => res3);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only diff between those 2 is the T2 type parameter. The fn2 case works today but the fn3 doesn't - even though its return type doesn't actually depend on T2.

Copy link
Member

Choose a reason for hiding this comment

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

How does fn3 fail? It looks like inference still fails, given that res3: (a: unknown) => void -- but I'm not sure, and I don't see how to observe what's inferred for T2. Maybe the return type of fn3 should be (a: T) => T2 in the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How does fn3 fail?

We end up with: "'res3' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.(7022)"

It looks like inference still fails, given that res3: (a: unknown) => void

It doesn't exactly fail, it's just that there are no inference candidates here so the constraint is used and that's unknown. This isn't meant to be used as a compelling use case for this PR, just a super minimal repro. The better motivating example is showcased in circularReferenceInReturnType2.ts.

I don't see how to observe what's inferred for T2.

It's just unknown. I re-checked this with console.log(typeToString(inference.typeParameter), typeToString(inference.inferredType)) before exiting getInferredType.

Maybe the return type of fn3 should be (a: T) => T2 in the test?

That's not good here because that reintroduces the circularity because the return type starts to depend on a type parameter again.

@sandersn
Copy link
Member

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 19, 2023

Hey @sandersn, 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/155528/artifacts?artifactName=tgz&fileId=CD5569389C68C626CC981FFA7D53848AD8D9738C271476309818945184221E5502&fileName=/typescript-5.2.0-insiders.20230619.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]".;

src/compiler/checker.ts Outdated Show resolved Hide resolved
tests/baselines/reference/arrayFrom.types Show resolved Hide resolved
Comment on lines +7 to +11
declare function fn2<T>(): (cb: () => any) => (a: T) => void;
const res2 = fn2()(() => res2);

declare function fn3<T>(): <T2>(cb: (arg: T2) => any) => (a: T) => void;
const res3 = fn3()(() => res3);
Copy link
Member

Choose a reason for hiding this comment

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

How does fn3 fail? It looks like inference still fails, given that res3: (a: unknown) => void -- but I'm not sure, and I don't see how to observe what's inferred for T2. Maybe the return type of fn3 should be (a: T) => T2 in the test?

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

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

Otherwise...

Something interesting changed - please have a look.

Details

rxjs-src

/mnt/ts_downloads/rxjs-src/build.sh

  • [NEW] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54477/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
  • [MISSING] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..54477
Metric main 54477 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 366,176k (± 0.01%) 366,130k (± 0.01%) -47k (- 0.01%) 366,090k 366,186k p=0.031 n=6
Parse Time 3.41s (± 0.34%) 3.40s (± 0.80%) ~ 3.38s 3.43s p=0.869 n=6
Bind Time 1.11s (± 0.94%) 1.12s (± 0.88%) ~ 1.10s 1.13s p=0.547 n=6
Check Time 8.80s (± 0.37%) 8.82s (± 0.61%) ~ 8.76s 8.89s p=0.570 n=6
Emit Time 7.41s (± 0.46%) 7.44s (± 0.53%) ~ 7.39s 7.50s p=0.169 n=6
Total Time 20.73s (± 0.21%) 20.78s (± 0.38%) ~ 20.69s 20.88s p=0.419 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 191,799k (± 1.18%) 190,859k (± 0.03%) ~ 190,749k 190,900k p=0.378 n=6
Parse Time 1.51s (± 0.50%) 1.51s (± 1.11%) ~ 1.50s 1.54s p=0.730 n=6
Bind Time 0.77s (± 0.97%) 0.77s (± 0.00%) ~ 0.77s 0.77s p=0.598 n=6
Check Time 9.51s (± 0.79%) 9.46s (± 0.27%) ~ 9.44s 9.50s p=0.468 n=6
Emit Time 2.76s (± 1.62%) 2.74s (± 1.16%) ~ 2.70s 2.79s p=0.629 n=6
Total Time 14.54s (± 0.59%) 14.48s (± 0.35%) ~ 14.42s 14.55s p=0.148 n=6
Monaco - node (v18.10.0, x64)
Memory used 346,613k (± 0.01%) 346,641k (± 0.01%) ~ 346,596k 346,686k p=0.173 n=6
Parse Time 2.58s (± 0.53%) 2.58s (± 0.57%) ~ 2.56s 2.60s p=0.934 n=6
Bind Time 1.00s (± 0.51%) 1.00s (± 0.41%) ~ 0.99s 1.00s p=0.114 n=6
Check Time 7.15s (± 0.32%) 7.16s (± 0.54%) ~ 7.11s 7.22s p=0.571 n=6
Emit Time 4.22s (± 0.24%) 4.24s (± 0.94%) ~ 4.19s 4.29s p=0.293 n=6
Total Time 14.95s (± 0.29%) 14.98s (± 0.45%) ~ 14.90s 15.08s p=0.521 n=6
TFS - node (v18.10.0, x64)
Memory used 300,653k (± 0.00%) 300,654k (± 0.01%) ~ 300,618k 300,682k p=1.000 n=6
Parse Time 2.06s (± 1.50%) 2.06s (± 1.08%) ~ 2.03s 2.09s p=0.870 n=6
Bind Time 1.13s (± 0.72%) 1.14s (± 0.66%) ~ 1.13s 1.15s p=0.082 n=6
Check Time 6.64s (± 0.43%) 6.65s (± 0.70%) ~ 6.60s 6.72s p=0.625 n=6
Emit Time 3.86s (± 0.61%) 3.86s (± 0.68%) ~ 3.83s 3.89s p=0.808 n=6
Total Time 13.69s (± 0.28%) 13.71s (± 0.25%) ~ 13.66s 13.76s p=0.686 n=6
material-ui - node (v18.10.0, x64)
Memory used 481,044k (± 0.00%) 481,035k (± 0.01%) ~ 480,998k 481,084k p=0.630 n=6
Parse Time 3.10s (± 0.17%) 3.10s (± 0.60%) ~ 3.08s 3.13s p=0.933 n=6
Bind Time 0.90s (± 0.57%) 0.91s (± 1.13%) ~ 0.90s 0.93s p=0.070 n=6
Check Time 16.85s (± 0.60%) 16.85s (± 0.59%) ~ 16.76s 17.04s 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 20.86s (± 0.46%) 20.87s (± 0.58%) ~ 20.76s 21.10s p=0.872 n=6
xstate - node (v18.10.0, x64)
Memory used 563,199k (± 0.03%) 563,183k (± 0.03%) ~ 562,930k 563,342k p=0.810 n=6
Parse Time 3.83s (± 0.35%) 3.82s (± 0.59%) ~ 3.80s 3.85s p=0.805 n=6
Bind Time 1.61s (± 0.65%) 1.62s (± 0.91%) ~ 1.60s 1.64s p=0.413 n=6
Check Time 2.79s (± 0.64%) 2.78s (± 0.83%) ~ 2.75s 2.81s p=0.573 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.32s (± 0.38%) 8.31s (± 0.24%) ~ 8.28s 8.33s p=0.373 n=6
Angular - node (v16.17.1, x64)
Memory used 365,533k (± 0.01%) 365,523k (± 0.01%) ~ 365,470k 365,583k p=0.688 n=6
Parse Time 3.56s (± 0.15%) 3.55s (± 0.47%) ~ 3.53s 3.57s p=0.666 n=6
Bind Time 1.18s (± 0.54%) 1.18s (± 0.64%) ~ 1.17s 1.19s p=0.718 n=6
Check Time 9.60s (± 0.56%) 9.64s (± 0.46%) ~ 9.59s 9.71s p=0.147 n=6
Emit Time 7.90s (± 0.52%) 7.95s (± 0.40%) +0.05s (+ 0.70%) 7.91s 8.00s p=0.024 n=6
Total Time 22.24s (± 0.38%) 22.33s (± 0.31%) ~ 22.20s 22.38s p=0.066 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,676k (± 0.92%) 193,170k (± 0.72%) ~ 192,552k 195,999k p=0.689 n=6
Parse Time 1.58s (± 1.35%) 1.60s (± 1.58%) ~ 1.55s 1.62s p=0.164 n=6
Bind Time 0.83s (± 0.62%) 0.82s (± 0.92%) ~ 0.81s 0.83s p=0.247 n=6
Check Time 10.15s (± 1.03%) 10.21s (± 1.13%) ~ 10.07s 10.42s p=0.422 n=6
Emit Time 3.00s (± 1.20%) 2.98s (± 0.46%) ~ 2.96s 2.99s p=0.166 n=6
Total Time 15.56s (± 0.62%) 15.61s (± 0.63%) ~ 15.48s 15.78s p=0.574 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,863k (± 0.00%) 345,886k (± 0.00%) +24k (+ 0.01%) 345,867k 345,903k p=0.013 n=6
Parse Time 2.73s (± 0.60%) 2.73s (± 0.60%) ~ 2.72s 2.76s p=1.000 n=6
Bind Time 1.08s (± 0.91%) 1.08s (± 0.97%) ~ 1.07s 1.10s p=0.547 n=6
Check Time 7.83s (± 0.51%) 7.90s (± 0.73%) +0.06s (+ 0.81%) 7.82s 7.99s p=0.044 n=6
Emit Time 4.43s (± 0.47%) 4.46s (± 0.85%) ~ 4.40s 4.50s p=0.195 n=6
Total Time 16.08s (± 0.35%) 16.17s (± 0.58%) ~ 16.06s 16.31s p=0.092 n=6
TFS - node (v16.17.1, x64)
Memory used 300,002k (± 0.01%) 299,984k (± 0.01%) ~ 299,956k 300,010k p=0.335 n=6
Parse Time 2.17s (± 0.79%) 2.15s (± 0.48%) ~ 2.14s 2.17s p=0.121 n=6
Bind Time 1.23s (± 1.11%) 1.23s (± 1.22%) ~ 1.21s 1.25s p=0.932 n=6
Check Time 7.31s (± 0.35%) 7.30s (± 0.57%) ~ 7.27s 7.38s p=0.258 n=6
Emit Time 4.37s (± 1.06%) 4.33s (± 0.48%) ~ 4.31s 4.36s p=0.256 n=6
Total Time 15.07s (± 0.41%) 15.02s (± 0.38%) ~ 14.98s 15.13s p=0.198 n=6
material-ui - node (v16.17.1, x64)
Memory used 480,336k (± 0.01%) 480,290k (± 0.00%) ~ 480,263k 480,314k p=0.173 n=6
Parse Time 3.26s (± 0.51%) 3.25s (± 0.45%) ~ 3.24s 3.28s p=0.247 n=6
Bind Time 0.94s (± 0.43%) 0.94s (± 0.55%) ~ 0.93s 0.94s p=0.595 n=6
Check Time 17.86s (± 0.52%) 17.89s (± 1.01%) ~ 17.69s 18.23s 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 22.06s (± 0.43%) 22.08s (± 0.88%) ~ 21.88s 22.45s p=1.000 n=6
xstate - node (v16.17.1, x64)
Memory used 560,637k (± 0.03%) 560,573k (± 0.01%) ~ 560,506k 560,627k p=0.873 n=6
Parse Time 3.99s (± 0.41%) 3.99s (± 0.46%) ~ 3.97s 4.01s p=0.517 n=6
Bind Time 1.75s (± 0.48%) 1.75s (± 0.78%) ~ 1.73s 1.77s p=0.672 n=6
Check Time 3.06s (± 0.41%) 3.07s (± 0.43%) ~ 3.05s 3.09s p=0.413 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.90s (± 0.35%) 8.90s (± 0.08%) ~ 8.89s 8.91s p=0.870 n=6
Angular - node (v14.21.3, x64)
Memory used 359,562k (± 0.01%) 359,616k (± 0.01%) ~ 359,577k 359,671k p=0.173 n=6
Parse Time 3.67s (± 0.76%) 3.67s (± 0.38%) ~ 3.64s 3.68s p=0.807 n=6
Bind Time 1.22s (± 0.67%) 1.22s (± 0.33%) ~ 1.22s 1.23s p=0.206 n=6
Check Time 10.06s (± 0.36%) 10.08s (± 0.52%) ~ 10.02s 10.17s p=0.747 n=6
Emit Time 8.33s (± 1.01%) 8.29s (± 0.25%) ~ 8.27s 8.32s p=0.573 n=6
Total Time 23.27s (± 0.51%) 23.25s (± 0.27%) ~ 23.16s 23.34s p=0.936 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used 188,480k (± 0.69%) 187,922k (± 0.02%) ~ 187,865k 187,965k p=0.128 n=6
Parse Time 1.61s (± 0.32%) 1.61s (± 0.32%) ~ 1.60s 1.61s p=1.000 n=6
Bind Time 0.84s (± 0.61%) 0.85s (± 0.61%) ~ 0.84s 0.85s p=0.311 n=6
Check Time 10.31s (± 0.49%) 10.32s (± 0.28%) ~ 10.28s 10.36s p=1.000 n=6
Emit Time 3.14s (± 1.50%) 3.12s (± 0.92%) ~ 3.08s 3.16s p=0.332 n=6
Total Time 15.91s (± 0.49%) 15.90s (± 0.30%) ~ 15.82s 15.96s p=0.470 n=6
Monaco - node (v14.21.3, x64)
Memory used 341,056k (± 0.00%) 341,043k (± 0.00%) ~ 341,028k 341,058k p=0.054 n=6
Parse Time 2.80s (± 0.57%) 2.79s (± 0.74%) ~ 2.77s 2.82s p=0.934 n=6
Bind Time 1.11s (± 0.80%) 1.11s (± 0.37%) ~ 1.10s 1.11s p=0.787 n=6
Check Time 8.23s (± 0.56%) 8.21s (± 0.69%) ~ 8.18s 8.32s p=0.292 n=6
Emit Time 4.69s (± 0.55%) 4.68s (± 0.81%) ~ 4.64s 4.73s p=0.871 n=6
Total Time 16.82s (± 0.45%) 16.80s (± 0.29%) ~ 16.73s 16.86s p=0.810 n=6
TFS - node (v14.21.3, x64)
Memory used 295,151k (± 0.00%) 295,154k (± 0.00%) ~ 295,138k 295,163k p=0.575 n=6
Parse Time 2.39s (± 0.61%) 2.40s (± 0.86%) ~ 2.37s 2.42s p=0.742 n=6
Bind Time 1.07s (± 1.50%) 1.07s (± 0.00%) ~ 1.07s 1.07s p=0.121 n=6
Check Time 7.63s (± 0.36%) 7.64s (± 0.30%) ~ 7.61s 7.67s p=0.807 n=6
Emit Time 4.33s (± 0.60%) 4.35s (± 0.95%) ~ 4.29s 4.39s p=0.467 n=6
Total Time 15.43s (± 0.14%) 15.45s (± 0.43%) ~ 15.37s 15.53s p=0.471 n=6
material-ui - node (v14.21.3, x64)
Memory used 475,882k (± 0.01%) 475,898k (± 0.00%) ~ 475,874k 475,911k p=0.575 n=6
Parse Time 3.32s (± 0.80%) 3.34s (± 0.41%) ~ 3.32s 3.35s p=0.371 n=6
Bind Time 1.00s (± 0.75%) 1.01s (± 0.54%) ~ 1.00s 1.01s p=0.476 n=6
Check Time 18.85s (± 0.77%) 18.80s (± 0.32%) ~ 18.71s 18.87s 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 23.17s (± 0.69%) 23.14s (± 0.26%) ~ 23.07s 23.21s p=0.936 n=6
xstate - node (v14.21.3, x64)
Memory used 549,643k (± 0.00%) 549,647k (± 0.00%) ~ 549,630k 549,672k p=0.687 n=6
Parse Time 4.22s (± 0.30%) 4.24s (± 0.55%) ~ 4.21s 4.27s p=0.183 n=6
Bind Time 1.67s (± 0.31%) 1.67s (± 0.31%) ~ 1.66s 1.67s p=1.000 n=6
Check Time 3.16s (± 0.55%) 3.15s (± 0.55%) ~ 3.13s 3.17s p=0.413 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 9.13s (± 0.27%) 9.15s (± 0.30%) ~ 9.11s 9.19s p=0.466 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 54477 6
Baseline main 6

TSServer

Comparison Report - main..54477
Metric main 54477 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,543ms (± 0.70%) 2,536ms (± 0.40%) ~ 2,524ms 2,554ms p=0.575 n=6
Req 2 - geterr 5,539ms (± 0.40%) 5,596ms (± 0.60%) +58ms (+ 1.04%) 5,546ms 5,634ms p=0.020 n=6
Req 3 - references 338ms (± 1.17%) 337ms (± 0.31%) ~ 336ms 338ms p=1.000 n=6
Req 4 - navto 287ms (± 0.48%) 286ms (± 0.36%) ~ 284ms 287ms p=0.391 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 (± 0.96%) 84ms (± 1.22%) ~ 83ms 86ms p=0.546 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,639ms (± 0.92%) 2,636ms (± 1.06%) ~ 2,589ms 2,668ms p=0.810 n=6
Req 2 - geterr 4,283ms (± 0.32%) 4,302ms (± 0.39%) ~ 4,282ms 4,323ms p=0.106 n=6
Req 3 - references 349ms (± 0.49%) 349ms (± 0.47%) ~ 347ms 351ms p=0.507 n=6
Req 4 - navto 286ms (± 1.05%) 286ms (± 0.62%) ~ 284ms 289ms p=0.935 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 64ms (± 4.17%) 66ms (± 6.14%) ~ 62ms 70ms p=0.800 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,086ms (± 0.33%) 3,078ms (± 0.27%) ~ 3,063ms 3,087ms p=0.199 n=6
Req 2 - geterr 1,550ms (± 0.81%) 1,562ms (± 1.19%) ~ 1,541ms 1,591ms p=0.230 n=6
Req 3 - references 112ms (± 1.87%) 112ms (± 1.31%) ~ 110ms 114ms p=0.625 n=6
Req 4 - navto 358ms (± 0.41%) 358ms (± 0.39%) ~ 356ms 360ms p=0.870 n=6
Req 5 - completionInfo count 2,864 (± 0.00%) 2,864 (± 0.00%) ~ 2,864 2,864 p=1.000 n=6
Req 5 - completionInfo 369ms (± 2.18%) 370ms (± 2.47%) ~ 362ms 385ms p=0.747 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,647ms (± 0.33%) 2,642ms (± 0.70%) ~ 2,618ms 2,661ms p=0.810 n=6
Req 2 - geterr 5,994ms (± 0.46%) 6,054ms (± 0.52%) +60ms (+ 1.00%) 6,020ms 6,108ms p=0.005 n=6
Req 3 - references 353ms (± 0.64%) 352ms (± 0.46%) ~ 350ms 354ms p=0.683 n=6
Req 4 - navto 288ms (± 2.06%) 289ms (± 1.66%) ~ 282ms 296ms p=0.625 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 91ms (± 2.13%) 92ms (± 2.47%) ~ 87ms 93ms p=0.197 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,827ms (± 0.63%) 2,830ms (± 0.48%) ~ 2,818ms 2,856ms p=0.936 n=6
Req 2 - geterr 4,656ms (± 0.37%) 4,655ms (± 0.31%) ~ 4,644ms 4,682ms p=0.873 n=6
Req 3 - references 363ms (± 0.53%) 364ms (± 0.47%) ~ 362ms 367ms p=0.368 n=6
Req 4 - navto 283ms (± 0.70%) 283ms (± 0.50%) ~ 281ms 285ms 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 67ms (± 0.94%) 67ms (± 0.77%) ~ 67ms 68ms p=0.386 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,220ms (± 0.56%) 3,216ms (± 0.34%) ~ 3,196ms 3,228ms p=1.000 n=6
Req 2 - geterr 1,728ms (± 0.96%) 1,724ms (± 0.68%) ~ 1,712ms 1,738ms p=0.748 n=6
Req 3 - references 126ms (± 7.00%) 122ms (± 0.73%) ~ 121ms 123ms p=0.157 n=6
Req 4 - navto 343ms (± 1.26%) 343ms (± 1.02%) ~ 338ms 348ms p=1.000 n=6
Req 5 - completionInfo count 2,864 (± 0.00%) 2,864 (± 0.00%) ~ 2,864 2,864 p=1.000 n=6
Req 5 - completionInfo 409ms (± 1.40%) 410ms (± 0.74%) ~ 408ms 416ms p=0.808 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,776ms (± 0.25%) 2,792ms (± 0.34%) +17ms (+ 0.59%) 2,779ms 2,803ms p=0.016 n=6
Req 2 - geterr 6,174ms (± 0.33%) 6,197ms (± 0.66%) ~ 6,155ms 6,251ms p=0.521 n=6
Req 3 - references 364ms (± 0.38%) 364ms (± 0.53%) ~ 361ms 366ms p=0.737 n=6
Req 4 - navto 288ms (± 0.36%) 288ms (± 0.41%) ~ 287ms 290ms p=0.801 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 102ms (± 2.77%) 100ms (± 1.64%) ~ 98ms 102ms p=0.253 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,971ms (± 0.44%) 2,976ms (± 0.29%) ~ 2,964ms 2,986ms p=0.419 n=6
Req 2 - geterr 4,542ms (± 0.65%) 4,557ms (± 0.62%) ~ 4,504ms 4,586ms p=0.378 n=6
Req 3 - references 373ms (± 0.89%) 371ms (± 0.49%) ~ 369ms 374ms p=0.569 n=6
Req 4 - navto 297ms (± 0.41%) 298ms (± 0.61%) ~ 296ms 300ms p=0.410 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 78ms (± 2.91%) 76ms (± 0.99%) ~ 75ms 77ms p=0.195 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 3,470ms (± 0.59%) 3,453ms (± 1.35%) ~ 3,386ms 3,497ms p=0.873 n=6
Req 2 - geterr 1,839ms (± 0.51%) 1,834ms (± 0.34%) ~ 1,823ms 1,841ms p=0.575 n=6
Req 3 - references 152ms (± 7.11%) 140ms (± 4.05%) ~ 133ms 150ms p=0.106 n=6
Req 4 - navto 406ms (± 1.62%) 404ms (± 1.16%) ~ 400ms 412ms p=0.747 n=6
Req 5 - completionInfo count 2,864 (± 0.00%) 2,864 (± 0.00%) ~ 2,864 2,864 p=1.000 n=6
Req 5 - completionInfo 439ms (± 1.26%) 434ms (± 3.84%) ~ 404ms 447ms p=0.872 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 54477 6
Baseline main 6

Startup

Comparison Report - main..54477
Metric main 54477 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 141.34ms (± 0.18%) 141.75ms (± 0.28%) +0.42ms (+ 0.30%) 140.47ms 145.79ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 220.31ms (± 0.19%) 220.27ms (± 0.20%) -0.04ms (- 0.02%) 219.13ms 227.93ms p=0.036 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 221.79ms (± 0.17%) 221.56ms (± 0.17%) -0.23ms (- 0.10%) 220.55ms 226.80ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 203.61ms (± 0.17%) 203.39ms (± 0.16%) -0.22ms (- 0.11%) 202.65ms 208.48ms 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 54477 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

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

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

1 similar comment
@typescript-bot
Copy link
Collaborator

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

Everything looks good!

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Since this isn't a bug fix, let's hold this till right at the beginning of 5.3 to give us plenty of time to watch for problems.

@sandersn sandersn merged commit afffad4 into microsoft:main Nov 29, 2023
19 checks passed
sandersn added a commit to sandersn/TypeScript that referenced this pull request Jan 24, 2024
Discovered in microsoft#57117

The implementation should not `couldContainTypeVariables`--it's not
intended a fast path, and should not be used in places where its
unreliability can be observed.

The tests stay, but with a note added that they should pass but do not.
DanielRosenwasser pushed a commit that referenced this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants