Skip to content

Fix type parameter comparability to consistently allow comparisons on unconstrained type parameters #48861

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 3 commits into from
May 9, 2022

Conversation

weswigham
Copy link
Member

*unless those comparisons to against other unrelated type parameters, since those are a stronger signal that the types are meant to be separate domains.

This is a change in philosophy to the more permissive side in the general case - comparability now consistently succeeds when relating any two types that overlap, unless the two are type parameters that don't extend one another in some way.

Fixes #48680

@weswigham
Copy link
Member Author

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

Heya @weswigham, I've started to run the diff-based community code test suite on this PR at 57f17bb. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

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

Update: The results are in!

@@ -19549,7 +19563,7 @@ namespace ts {
if (sourceFlags & TypeFlags.TypeVariable) {
// IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
if (!(sourceFlags & TypeFlags.IndexedAccess && targetFlags & TypeFlags.IndexedAccess)) {
const constraint = getConstraintOfType(source as TypeVariable);
const constraint = getConstraintOfType(source as TypeVariable) || unknownType;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the core of this fix. This is really all we need to make it so T extends unknown and a bare T are actually treated identically.

@@ -19338,6 +19338,20 @@ namespace ts {
}
}
}
if (relation === comparableRelation && sourceFlags & TypeFlags.TypeParameter) {
// This is a carve-out in comparability to essentially forbid comparing a type parameter
// with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
Copy link
Member Author

Choose a reason for hiding this comment

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

This, meanwhile, is a change to make is slightly more strict in all circumstances involving comparing one type parameter to another (regardless if one or both are constrained) so we still forbid comparing two unrelated type parameters, despite the below change.


case 2: x; break; // T & 2
>2 : 2
>x : T & 2
>x : (T & 1) | (T & 2)
Copy link
Member Author

Choose a reason for hiding this comment

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

Fallout from permissive comparability: We use comparability in switch-case narrowing (in narrowTypeBySwitchOnDiscriminant) and since T is unconstrained and thus extends unknown, both the 1 and 2 intersections are considered comparable with both 1 and 2 because of the T part. Some extra work could possibly be done to prevent this by changing how comparability works over intersections, probably.

Copy link
Member Author

Choose a reason for hiding this comment

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

(It's likely a similar change occurs in narrowing assignments, since we also use bidirectional comparability there, and maybe in other places more subtly since we use unidirectional comparability in narrowTypeByDiscriminant)

@typescript-bot
Copy link
Collaborator

@weswigham
Great news! no new errors were found between main..refs/pull/48861/merge

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

Hey @weswigham, 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/125180/artifacts?artifactName=tgz&fileId=7D872375D4A76DD181DFBA5F12BA09DC47AB7229F94AF140AB3557FDAD93742E02&fileName=/typescript-4.7.0-insiders.20220427.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@4.7.0-pr-48861-7".;

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..48861

Metric main 48861 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 357,437k (± 0.01%) 357,455k (± 0.03%) +18k (+ 0.01%) 357,269k 357,707k
Parse Time 2.06s (± 0.36%) 2.06s (± 0.63%) -0.00s (- 0.05%) 2.03s 2.10s
Bind Time 0.86s (± 0.78%) 0.87s (± 2.94%) +0.01s (+ 1.63%) 0.84s 0.97s
Check Time 5.85s (± 0.36%) 5.84s (± 0.44%) -0.01s (- 0.19%) 5.78s 5.91s
Emit Time 6.00s (± 0.44%) 5.98s (± 0.47%) -0.02s (- 0.38%) 5.92s 6.04s
Total Time 14.76s (± 0.33%) 14.75s (± 0.25%) -0.02s (- 0.12%) 14.68s 14.82s
Compiler-Unions - node (v10.16.3, x64)
Memory used 205,960k (± 0.04%) 205,971k (± 0.04%) +12k (+ 0.01%) 205,784k 206,193k
Parse Time 0.84s (± 0.53%) 0.84s (± 0.69%) +0.00s (+ 0.12%) 0.83s 0.85s
Bind Time 0.51s (± 0.66%) 0.51s (± 0.78%) -0.00s (- 0.39%) 0.50s 0.52s
Check Time 7.92s (± 0.71%) 7.89s (± 0.51%) -0.03s (- 0.38%) 7.84s 8.01s
Emit Time 2.49s (± 1.04%) 2.48s (± 0.64%) -0.01s (- 0.28%) 2.45s 2.52s
Total Time 11.77s (± 0.47%) 11.73s (± 0.35%) -0.04s (- 0.33%) 11.66s 11.85s
Monaco - node (v10.16.3, x64)
Memory used 343,793k (± 0.03%) 343,787k (± 0.02%) -7k (- 0.00%) 343,662k 343,891k
Parse Time 1.57s (± 0.42%) 1.58s (± 0.47%) +0.01s (+ 0.64%) 1.56s 1.59s
Bind Time 0.76s (± 0.48%) 0.76s (± 0.81%) +0.00s (+ 0.40%) 0.74s 0.77s
Check Time 5.77s (± 0.63%) 5.79s (± 0.38%) +0.02s (+ 0.38%) 5.75s 5.86s
Emit Time 3.23s (± 0.59%) 3.22s (± 0.53%) -0.01s (- 0.25%) 3.19s 3.28s
Total Time 11.33s (± 0.38%) 11.35s (± 0.22%) +0.03s (+ 0.23%) 11.32s 11.43s
TFS - node (v10.16.3, x64)
Memory used 305,380k (± 0.03%) 305,406k (± 0.04%) +26k (+ 0.01%) 305,229k 305,709k
Parse Time 1.29s (± 0.46%) 1.29s (± 0.58%) +0.00s (+ 0.08%) 1.27s 1.31s
Bind Time 0.72s (± 0.69%) 0.71s (± 1.16%) -0.00s (- 0.14%) 0.70s 0.74s
Check Time 5.25s (± 0.51%) 5.25s (± 0.30%) -0.00s (- 0.04%) 5.22s 5.29s
Emit Time 3.46s (± 1.61%) 3.42s (± 1.03%) -0.04s (- 1.13%) 3.35s 3.50s
Total Time 10.71s (± 0.56%) 10.67s (± 0.28%) -0.04s (- 0.41%) 10.61s 10.76s
material-ui - node (v10.16.3, x64)
Memory used 470,483k (± 0.01%) 470,499k (± 0.01%) +16k (+ 0.00%) 470,337k 470,551k
Parse Time 1.81s (± 0.40%) 1.82s (± 0.38%) +0.01s (+ 0.50%) 1.80s 1.83s
Bind Time 0.68s (± 0.73%) 0.67s (± 1.04%) -0.00s (- 0.74%) 0.65s 0.68s
Check Time 14.26s (± 0.52%) 14.29s (± 0.41%) +0.03s (+ 0.24%) 14.16s 14.43s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.74s (± 0.46%) 16.78s (± 0.37%) +0.04s (+ 0.24%) 16.65s 16.93s
xstate - node (v10.16.3, x64)
Memory used 572,534k (± 0.02%) 572,558k (± 0.01%) +24k (+ 0.00%) 572,434k 572,713k
Parse Time 2.57s (± 0.44%) 2.58s (± 0.26%) +0.01s (+ 0.23%) 2.56s 2.59s
Bind Time 1.00s (± 0.47%) 1.00s (± 0.98%) -0.00s (- 0.10%) 0.99s 1.03s
Check Time 1.52s (± 0.54%) 1.52s (± 0.49%) +0.00s (+ 0.20%) 1.50s 1.54s
Emit Time 0.07s (± 0.00%) 0.07s (± 3.14%) +0.00s (+ 1.43%) 0.07s 0.08s
Total Time 5.16s (± 0.34%) 5.17s (± 0.37%) +0.01s (+ 0.17%) 5.12s 5.21s
Angular - node (v12.1.0, x64)
Memory used 335,197k (± 0.02%) 335,181k (± 0.01%) -16k (- 0.00%) 335,100k 335,301k
Parse Time 2.06s (± 0.56%) 2.07s (± 0.57%) +0.01s (+ 0.24%) 2.05s 2.10s
Bind Time 0.84s (± 0.69%) 0.83s (± 0.72%) -0.01s (- 0.95%) 0.82s 0.85s
Check Time 5.68s (± 0.91%) 5.68s (± 0.92%) -0.00s (- 0.07%) 5.62s 5.87s
Emit Time 6.26s (± 0.57%) 6.26s (± 0.50%) +0.00s (+ 0.03%) 6.18s 6.32s
Total Time 14.84s (± 0.48%) 14.84s (± 0.40%) -0.00s (- 0.02%) 14.74s 15.02s
Compiler-Unions - node (v12.1.0, x64)
Memory used 193,285k (± 0.16%) 193,293k (± 0.14%) +8k (+ 0.00%) 192,790k 193,708k
Parse Time 0.84s (± 0.83%) 0.85s (± 0.87%) +0.01s (+ 1.07%) 0.84s 0.87s
Bind Time 0.53s (± 0.64%) 0.53s (± 0.76%) -0.00s (- 0.75%) 0.52s 0.54s
Check Time 7.45s (± 0.49%) 7.40s (± 0.53%) -0.05s (- 0.67%) 7.32s 7.51s
Emit Time 2.58s (± 1.34%) 2.57s (± 1.13%) -0.01s (- 0.31%) 2.52s 2.64s
Total Time 11.41s (± 0.48%) 11.36s (± 0.41%) -0.05s (- 0.45%) 11.25s 11.48s
Monaco - node (v12.1.0, x64)
Memory used 326,778k (± 0.03%) 326,729k (± 0.02%) -49k (- 0.02%) 326,576k 326,890k
Parse Time 1.54s (± 0.94%) 1.55s (± 0.77%) +0.01s (+ 0.58%) 1.53s 1.59s
Bind Time 0.74s (± 0.78%) 0.74s (± 1.10%) 0.00s ( 0.00%) 0.73s 0.76s
Check Time 5.64s (± 0.41%) 5.63s (± 0.61%) -0.01s (- 0.23%) 5.55s 5.71s
Emit Time 3.24s (± 0.47%) 3.24s (± 0.46%) +0.00s (+ 0.06%) 3.22s 3.28s
Total Time 11.17s (± 0.29%) 11.16s (± 0.39%) -0.01s (- 0.07%) 11.09s 11.28s
TFS - node (v12.1.0, x64)
Memory used 290,014k (± 0.02%) 290,015k (± 0.02%) +1k (+ 0.00%) 289,859k 290,083k
Parse Time 1.30s (± 0.68%) 1.30s (± 0.68%) +0.00s (+ 0.08%) 1.28s 1.32s
Bind Time 0.71s (± 0.48%) 0.70s (± 0.68%) -0.01s (- 1.41%) 0.69s 0.71s
Check Time 5.19s (± 0.49%) 5.19s (± 0.68%) -0.00s (- 0.10%) 5.10s 5.26s
Emit Time 3.46s (± 0.92%) 3.50s (± 0.56%) +0.04s (+ 1.27%) 3.47s 3.56s
Total Time 10.66s (± 0.43%) 10.69s (± 0.38%) +0.03s (+ 0.24%) 10.59s 10.76s
material-ui - node (v12.1.0, x64)
Memory used 449,442k (± 0.01%) 449,484k (± 0.01%) +42k (+ 0.01%) 449,370k 449,586k
Parse Time 1.81s (± 0.39%) 1.82s (± 0.36%) +0.01s (+ 0.61%) 1.80s 1.83s
Bind Time 0.65s (± 0.95%) 0.65s (± 0.72%) +0.00s (+ 0.15%) 0.64s 0.66s
Check Time 12.84s (± 0.41%) 12.83s (± 0.27%) -0.01s (- 0.04%) 12.76s 12.91s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.30s (± 0.32%) 15.30s (± 0.23%) +0.00s (+ 0.03%) 15.24s 15.38s
xstate - node (v12.1.0, x64)
Memory used 538,108k (± 0.02%) 538,126k (± 0.02%) +18k (+ 0.00%) 537,876k 538,265k
Parse Time 2.52s (± 0.26%) 2.53s (± 0.82%) +0.00s (+ 0.20%) 2.49s 2.59s
Bind Time 1.03s (± 0.60%) 1.03s (± 0.56%) +0.00s (+ 0.19%) 1.02s 1.05s
Check Time 1.46s (± 0.33%) 1.47s (± 0.64%) +0.01s (+ 0.48%) 1.45s 1.50s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.09s (± 0.22%) 5.10s (± 0.48%) +0.02s (+ 0.31%) 5.05s 5.17s
Angular - node (v14.15.1, x64)
Memory used 333,430k (± 0.01%) 333,444k (± 0.01%) +14k (+ 0.00%) 333,357k 333,494k
Parse Time 2.03s (± 0.44%) 2.03s (± 0.58%) +0.00s (+ 0.10%) 2.01s 2.06s
Bind Time 0.88s (± 0.66%) 0.87s (± 0.56%) -0.00s (- 0.34%) 0.87s 0.89s
Check Time 5.65s (± 0.59%) 5.63s (± 0.58%) -0.01s (- 0.21%) 5.57s 5.68s
Emit Time 6.33s (± 0.55%) 6.29s (± 0.67%) -0.03s (- 0.52%) 6.23s 6.42s
Total Time 14.88s (± 0.33%) 14.83s (± 0.43%) -0.05s (- 0.33%) 14.71s 14.99s
Compiler-Unions - node (v14.15.1, x64)
Memory used 192,201k (± 0.02%) 192,190k (± 0.01%) -11k (- 0.01%) 192,157k 192,240k
Parse Time 0.85s (± 0.78%) 0.86s (± 0.77%) +0.01s (+ 0.82%) 0.85s 0.87s
Bind Time 0.56s (± 0.71%) 0.56s (± 0.72%) -0.00s (- 0.36%) 0.55s 0.57s
Check Time 7.47s (± 0.49%) 7.49s (± 0.35%) +0.02s (+ 0.27%) 7.43s 7.57s
Emit Time 2.51s (± 0.92%) 2.50s (± 0.59%) -0.01s (- 0.60%) 2.46s 2.54s
Total Time 11.40s (± 0.32%) 11.41s (± 0.31%) +0.01s (+ 0.12%) 11.35s 11.51s
Monaco - node (v14.15.1, x64)
Memory used 325,525k (± 0.01%) 325,513k (± 0.01%) -12k (- 0.00%) 325,471k 325,552k
Parse Time 1.57s (± 0.67%) 1.58s (± 0.60%) +0.01s (+ 0.64%) 1.56s 1.60s
Bind Time 0.77s (± 0.47%) 0.77s (± 0.94%) -0.00s (- 0.26%) 0.75s 0.79s
Check Time 5.55s (± 0.48%) 5.54s (± 0.46%) -0.01s (- 0.23%) 5.49s 5.60s
Emit Time 3.34s (± 0.89%) 3.32s (± 0.52%) -0.01s (- 0.39%) 3.29s 3.37s
Total Time 11.23s (± 0.50%) 11.21s (± 0.22%) -0.02s (- 0.16%) 11.18s 11.29s
TFS - node (v14.15.1, x64)
Memory used 289,052k (± 0.00%) 289,074k (± 0.01%) +22k (+ 0.01%) 289,044k 289,112k
Parse Time 1.35s (± 0.89%) 1.35s (± 0.41%) -0.00s (- 0.15%) 1.34s 1.37s
Bind Time 0.72s (± 1.15%) 0.74s (± 1.64%) +0.01s (+ 1.38%) 0.71s 0.77s
Check Time 5.20s (± 0.49%) 5.19s (± 0.56%) -0.01s (- 0.21%) 5.13s 5.28s
Emit Time 3.57s (± 1.51%) 3.52s (± 2.10%) -0.05s (- 1.37%) 3.38s 3.66s
Total Time 10.85s (± 0.71%) 10.80s (± 0.57%) -0.05s (- 0.45%) 10.68s 10.95s
material-ui - node (v14.15.1, x64)
Memory used 447,797k (± 0.00%) 447,712k (± 0.04%) -84k (- 0.02%) 447,039k 447,816k
Parse Time 1.87s (± 0.51%) 1.87s (± 0.41%) +0.00s (+ 0.16%) 1.85s 1.88s
Bind Time 0.70s (± 0.85%) 0.69s (± 0.48%) -0.01s (- 0.86%) 0.68s 0.70s
Check Time 12.96s (± 0.36%) 13.01s (± 0.57%) +0.05s (+ 0.37%) 12.87s 13.23s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.52s (± 0.30%) 15.57s (± 0.47%) +0.05s (+ 0.30%) 15.41s 15.77s
xstate - node (v14.15.1, x64)
Memory used 535,911k (± 0.00%) 535,905k (± 0.01%) -6k (- 0.00%) 535,840k 535,975k
Parse Time 2.59s (± 0.36%) 2.58s (± 0.39%) -0.01s (- 0.35%) 2.56s 2.61s
Bind Time 1.14s (± 0.57%) 1.15s (± 1.37%) +0.01s (+ 0.61%) 1.13s 1.21s
Check Time 1.51s (± 0.32%) 1.50s (± 0.45%) -0.00s (- 0.20%) 1.49s 1.52s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.32s (± 0.24%) 5.31s (± 0.35%) -0.01s (- 0.17%) 5.28s 5.37s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory2 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v10.16.3, x64)
  • xstate - node (v12.1.0, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 48861 10
Baseline main 10

Developer Information:

Download Benchmark

@weswigham
Copy link
Member Author

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

Heya @weswigham, I've started to run the diff-based community code test suite on this PR at 4c7e818. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

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

@typescript-bot
Copy link
Collaborator

@weswigham
Great news! no new errors were found between main..refs/pull/48861/merge

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 27, 2022

Hey @weswigham, 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/125215/artifacts?artifactName=tgz&fileId=30E342AFDCDAC8BB8D2E5B22591CBA14C0F70609B73C2523318A78609A3EB7CB02&fileName=/typescript-4.7.0-insiders.20220427.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@4.7.0-pr-48861-16".;

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..48861

Metric main 48861 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 357,484k (± 0.03%) 357,454k (± 0.01%) -30k (- 0.01%) 357,371k 357,550k
Parse Time 2.07s (± 0.36%) 2.06s (± 0.59%) -0.00s (- 0.10%) 2.04s 2.09s
Bind Time 0.87s (± 1.80%) 0.86s (± 0.60%) -0.01s (- 0.69%) 0.85s 0.87s
Check Time 5.85s (± 0.62%) 5.85s (± 0.49%) -0.01s (- 0.10%) 5.78s 5.91s
Emit Time 6.02s (± 1.03%) 6.03s (± 0.77%) +0.00s (+ 0.05%) 5.94s 6.11s
Total Time 14.81s (± 0.54%) 14.80s (± 0.39%) -0.01s (- 0.07%) 14.66s 14.93s
Compiler-Unions - node (v10.16.3, x64)
Memory used 205,991k (± 0.02%) 205,912k (± 0.02%) -79k (- 0.04%) 205,816k 206,002k
Parse Time 0.84s (± 0.66%) 0.84s (± 0.44%) +0.00s (+ 0.36%) 0.84s 0.85s
Bind Time 0.51s (± 0.71%) 0.51s (± 0.66%) -0.00s (- 0.19%) 0.51s 0.52s
Check Time 7.89s (± 0.67%) 7.93s (± 0.72%) +0.04s (+ 0.52%) 7.84s 8.07s
Emit Time 2.51s (± 1.14%) 2.49s (± 1.07%) -0.02s (- 0.84%) 2.43s 2.56s
Total Time 11.76s (± 0.58%) 11.78s (± 0.58%) +0.02s (+ 0.20%) 11.67s 11.94s
Monaco - node (v10.16.3, x64)
Memory used 343,771k (± 0.01%) 343,782k (± 0.02%) +12k (+ 0.00%) 343,624k 343,904k
Parse Time 1.58s (± 0.31%) 1.58s (± 0.47%) +0.00s (+ 0.06%) 1.56s 1.59s
Bind Time 0.76s (± 0.58%) 0.76s (± 0.76%) -0.00s (- 0.26%) 0.75s 0.77s
Check Time 5.82s (± 0.46%) 5.82s (± 0.28%) +0.00s (+ 0.07%) 5.78s 5.87s
Emit Time 3.26s (± 0.37%) 3.25s (± 0.65%) -0.01s (- 0.34%) 3.21s 3.30s
Total Time 11.42s (± 0.27%) 11.41s (± 0.33%) -0.01s (- 0.11%) 11.32s 11.52s
TFS - node (v10.16.3, x64)
Memory used 305,361k (± 0.03%) 305,414k (± 0.02%) +53k (+ 0.02%) 305,315k 305,633k
Parse Time 1.29s (± 0.72%) 1.29s (± 0.43%) -0.00s (- 0.00%) 1.28s 1.30s
Bind Time 0.72s (± 1.03%) 0.72s (± 0.84%) -0.00s (- 0.69%) 0.70s 0.73s
Check Time 5.26s (± 0.62%) 5.23s (± 0.53%) -0.03s (- 0.51%) 5.18s 5.31s
Emit Time 3.47s (± 1.11%) 3.42s (± 1.34%) -0.05s (- 1.50%) 3.34s 3.51s
Total Time 10.74s (± 0.61%) 10.65s (± 0.55%) -0.08s (- 0.78%) 10.54s 10.80s
material-ui - node (v10.16.3, x64)
Memory used 470,463k (± 0.01%) 470,445k (± 0.01%) -18k (- 0.00%) 470,292k 470,552k
Parse Time 1.82s (± 0.33%) 1.82s (± 0.42%) -0.01s (- 0.49%) 1.80s 1.83s
Bind Time 0.68s (± 0.86%) 0.68s (± 1.03%) +0.00s (+ 0.59%) 0.67s 0.70s
Check Time 14.33s (± 0.86%) 14.29s (± 0.62%) -0.05s (- 0.35%) 14.20s 14.62s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.84s (± 0.73%) 16.78s (± 0.58%) -0.05s (- 0.33%) 16.69s 17.15s
xstate - node (v10.16.3, x64)
Memory used 575,853k (± 1.24%) 579,034k (± 1.65%) +3,181k (+ 0.55%) 572,498k 604,775k
Parse Time 2.59s (± 0.50%) 2.58s (± 0.31%) -0.01s (- 0.27%) 2.57s 2.60s
Bind Time 1.01s (± 0.77%) 1.01s (± 0.59%) -0.00s (- 0.49%) 0.99s 1.02s
Check Time 1.52s (± 0.55%) 1.52s (± 0.58%) -0.00s (- 0.07%) 1.49s 1.54s
Emit Time 0.07s (± 3.14%) 0.07s (± 0.00%) -0.00s (- 1.41%) 0.07s 0.07s
Total Time 5.19s (± 0.33%) 5.18s (± 0.19%) -0.01s (- 0.25%) 5.16s 5.20s
Angular - node (v12.1.0, x64)
Memory used 335,194k (± 0.01%) 335,241k (± 0.02%) +47k (+ 0.01%) 335,052k 335,488k
Parse Time 2.08s (± 0.41%) 2.07s (± 0.54%) -0.01s (- 0.38%) 2.04s 2.09s
Bind Time 0.84s (± 0.77%) 0.84s (± 0.48%) -0.00s (- 0.12%) 0.83s 0.85s
Check Time 5.66s (± 0.51%) 5.65s (± 0.51%) -0.01s (- 0.23%) 5.56s 5.70s
Emit Time 6.30s (± 0.54%) 6.26s (± 0.76%) -0.04s (- 0.65%) 6.16s 6.36s
Total Time 14.88s (± 0.37%) 14.82s (± 0.42%) -0.06s (- 0.42%) 14.70s 14.97s
Compiler-Unions - node (v12.1.0, x64)
Memory used 193,099k (± 0.31%) 193,229k (± 0.14%) +130k (+ 0.07%) 192,529k 193,662k
Parse Time 0.85s (± 1.83%) 0.84s (± 1.26%) -0.01s (- 0.94%) 0.82s 0.87s
Bind Time 0.54s (± 0.89%) 0.54s (± 0.92%) -0.00s (- 0.19%) 0.53s 0.55s
Check Time 7.42s (± 0.63%) 7.43s (± 0.76%) +0.01s (+ 0.18%) 7.36s 7.58s
Emit Time 2.57s (± 1.32%) 2.57s (± 1.29%) +0.00s (+ 0.12%) 2.50s 2.65s
Total Time 11.38s (± 0.56%) 11.39s (± 0.69%) +0.01s (+ 0.09%) 11.25s 11.60s
Monaco - node (v12.1.0, x64)
Memory used 326,742k (± 0.02%) 326,720k (± 0.02%) -22k (- 0.01%) 326,553k 326,833k
Parse Time 1.56s (± 0.89%) 1.55s (± 0.79%) -0.01s (- 0.58%) 1.53s 1.59s
Bind Time 0.74s (± 0.83%) 0.74s (± 0.60%) +0.00s (+ 0.41%) 0.73s 0.75s
Check Time 5.65s (± 0.53%) 5.65s (± 0.47%) +0.00s (+ 0.00%) 5.60s 5.70s
Emit Time 3.27s (± 1.17%) 3.26s (± 0.87%) -0.01s (- 0.43%) 3.20s 3.33s
Total Time 11.22s (± 0.44%) 11.20s (± 0.47%) -0.02s (- 0.19%) 11.11s 11.31s
TFS - node (v12.1.0, x64)
Memory used 290,007k (± 0.02%) 290,073k (± 0.02%) +66k (+ 0.02%) 289,915k 290,204k
Parse Time 1.31s (± 0.45%) 1.31s (± 0.72%) +0.00s (+ 0.08%) 1.29s 1.32s
Bind Time 0.70s (± 1.42%) 0.70s (± 0.80%) -0.01s (- 0.71%) 0.69s 0.71s
Check Time 5.19s (± 0.30%) 5.18s (± 0.29%) -0.00s (- 0.08%) 5.15s 5.21s
Emit Time 3.49s (± 1.03%) 3.50s (± 0.89%) +0.01s (+ 0.20%) 3.41s 3.58s
Total Time 10.69s (± 0.42%) 10.68s (± 0.37%) -0.00s (- 0.03%) 10.60s 10.78s
material-ui - node (v12.1.0, x64)
Memory used 449,343k (± 0.07%) 449,373k (± 0.05%) +31k (+ 0.01%) 448,434k 449,663k
Parse Time 1.83s (± 0.66%) 1.82s (± 0.45%) -0.01s (- 0.38%) 1.80s 1.84s
Bind Time 0.65s (± 0.91%) 0.65s (± 0.85%) -0.00s (- 0.31%) 0.64s 0.67s
Check Time 13.01s (± 1.03%) 12.93s (± 0.69%) -0.08s (- 0.61%) 12.79s 13.22s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.49s (± 0.92%) 15.40s (± 0.59%) -0.09s (- 0.56%) 15.26s 15.68s
xstate - node (v12.1.0, x64)
Memory used 538,166k (± 0.01%) 538,238k (± 0.02%) +73k (+ 0.01%) 538,038k 538,501k
Parse Time 2.53s (± 0.52%) 2.55s (± 0.45%) +0.02s (+ 0.63%) 2.53s 2.58s
Bind Time 1.03s (± 0.36%) 1.04s (± 0.66%) +0.00s (+ 0.10%) 1.02s 1.05s
Check Time 1.47s (± 0.69%) 1.48s (± 0.63%) +0.01s (+ 0.48%) 1.46s 1.50s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.11s (± 0.19%) 5.13s (± 0.40%) +0.02s (+ 0.47%) 5.09s 5.17s
Angular - node (v14.15.1, x64)
Memory used 333,413k (± 0.01%) 333,430k (± 0.01%) +17k (+ 0.01%) 333,386k 333,459k
Parse Time 2.05s (± 0.51%) 2.03s (± 0.36%) -0.02s (- 1.17%) 2.01s 2.04s
Bind Time 0.88s (± 0.56%) 0.88s (± 0.56%) 0.00s ( 0.00%) 0.87s 0.89s
Check Time 5.64s (± 0.59%) 5.62s (± 0.40%) -0.02s (- 0.34%) 5.57s 5.69s
Emit Time 6.35s (± 0.75%) 6.29s (± 0.71%) -0.06s (- 0.91%) 6.21s 6.43s
Total Time 14.92s (± 0.46%) 14.82s (± 0.37%) -0.10s (- 0.70%) 14.70s 14.94s
Compiler-Unions - node (v14.15.1, x64)
Memory used 192,179k (± 0.02%) 192,154k (± 0.09%) -25k (- 0.01%) 191,487k 192,302k
Parse Time 0.86s (± 0.68%) 0.86s (± 0.85%) +0.00s (+ 0.12%) 0.84s 0.87s
Bind Time 0.56s (± 0.84%) 0.56s (± 0.65%) +0.00s (+ 0.18%) 0.56s 0.57s
Check Time 7.54s (± 0.48%) 7.54s (± 0.80%) +0.00s (+ 0.05%) 7.42s 7.65s
Emit Time 2.51s (± 0.50%) 2.52s (± 0.81%) +0.01s (+ 0.40%) 2.49s 2.59s
Total Time 11.46s (± 0.43%) 11.48s (± 0.58%) +0.02s (+ 0.16%) 11.34s 11.59s
Monaco - node (v14.15.1, x64)
Memory used 325,489k (± 0.01%) 325,525k (± 0.01%) +36k (+ 0.01%) 325,462k 325,610k
Parse Time 1.58s (± 1.15%) 1.56s (± 0.44%) -0.02s (- 1.20%) 1.55s 1.58s
Bind Time 0.77s (± 0.75%) 0.77s (± 0.58%) -0.00s (- 0.13%) 0.76s 0.78s
Check Time 5.56s (± 0.27%) 5.56s (± 0.36%) +0.00s (+ 0.05%) 5.51s 5.60s
Emit Time 3.31s (± 0.79%) 3.34s (± 0.48%) +0.02s (+ 0.75%) 3.30s 3.37s
Total Time 11.22s (± 0.28%) 11.24s (± 0.30%) +0.01s (+ 0.09%) 11.14s 11.31s
TFS - node (v14.15.1, x64)
Memory used 289,079k (± 0.01%) 289,067k (± 0.01%) -12k (- 0.00%) 288,994k 289,128k
Parse Time 1.37s (± 0.61%) 1.36s (± 0.75%) -0.00s (- 0.37%) 1.35s 1.40s
Bind Time 0.72s (± 0.47%) 0.72s (± 0.47%) 0.00s ( 0.00%) 0.72s 0.73s
Check Time 5.19s (± 0.15%) 5.20s (± 0.35%) +0.01s (+ 0.25%) 5.16s 5.24s
Emit Time 3.55s (± 2.36%) 3.49s (± 1.89%) -0.06s (- 1.58%) 3.38s 3.61s
Total Time 10.82s (± 0.80%) 10.78s (± 0.63%) -0.05s (- 0.43%) 10.63s 10.88s
material-ui - node (v14.15.1, x64)
Memory used 447,805k (± 0.01%) 447,814k (± 0.00%) +9k (+ 0.00%) 447,755k 447,844k
Parse Time 1.88s (± 0.32%) 1.88s (± 0.59%) -0.00s (- 0.05%) 1.85s 1.90s
Bind Time 0.70s (± 0.71%) 0.70s (± 0.52%) -0.00s (- 0.00%) 0.69s 0.70s
Check Time 13.03s (± 0.60%) 13.01s (± 0.47%) -0.01s (- 0.11%) 12.88s 13.17s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.60s (± 0.50%) 15.58s (± 0.40%) -0.02s (- 0.11%) 15.45s 15.73s
xstate - node (v14.15.1, x64)
Memory used 535,894k (± 0.00%) 535,906k (± 0.00%) +12k (+ 0.00%) 535,870k 535,968k
Parse Time 2.60s (± 0.70%) 2.60s (± 0.55%) -0.00s (- 0.08%) 2.56s 2.63s
Bind Time 1.15s (± 0.73%) 1.15s (± 0.67%) -0.00s (- 0.00%) 1.13s 1.17s
Check Time 1.51s (± 0.41%) 1.51s (± 0.39%) -0.00s (- 0.20%) 1.50s 1.52s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.33s (± 0.46%) 5.32s (± 0.31%) -0.01s (- 0.24%) 5.26s 5.34s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory2 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v10.16.3, x64)
  • xstate - node (v12.1.0, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 48861 10
Baseline main 10

Developer Information:

Download Benchmark

Copy link
Member

@DanielRosenwasser DanielRosenwasser left a comment

Choose a reason for hiding this comment

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

Seems reasonable from a glance. I'd get another sign off, and I'd be curious to get Ryan's take on this before 4.7 goes out (though I think the new carve-out was the only thing he and I had ever discussed where the more-restrictive behavior was compelling).

@DanielRosenwasser
Copy link
Member

@ahejlsberg do you feel comfortable with us bringing this in?

@weswigham weswigham merged commit f84ec3e into microsoft:main May 9, 2022
@weswigham
Copy link
Member Author

@DanielRosenwasser do you still want to cherry pick this for 4.7?

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
Development

Successfully merging this pull request may close these issues.

Unconstrained type parameter has stricter comparability rules than extends unknown
5 participants