Skip to content

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

Merged
Wesley Wigham (weswigham) merged 3 commits into
microsoft:mainfrom
weswigham:type-parameter-comparability
May 9, 2022
Merged

Fix type parameter comparability to consistently allow comparisons on unconstrained type parameters#48861
Wesley Wigham (weswigham) merged 3 commits into
microsoft:mainfrom
weswigham:type-parameter-comparability

Conversation

@weswigham

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

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

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

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

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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!

// 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
Copy Markdown
MemberAuthor

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.

}
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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

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

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

Hey Wesley Wigham (@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".;

Comment threadsrc/compiler/checker.ts Outdated
@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
The results of the perf run you requested are in!

Here they are:

Comparison Report - main..48861

Metricmain48861DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used357,437k (± 0.01%)357,455k (± 0.03%)+18k (+ 0.01%)357,269k357,707k
Parse Time2.06s (± 0.36%)2.06s (± 0.63%)-0.00s (- 0.05%)2.03s2.10s
Bind Time0.86s (± 0.78%)0.87s (± 2.94%)+0.01s (+ 1.63%)0.84s0.97s
Check Time5.85s (± 0.36%)5.84s (± 0.44%)-0.01s (- 0.19%)5.78s5.91s
Emit Time6.00s (± 0.44%)5.98s (± 0.47%)-0.02s (- 0.38%)5.92s6.04s
Total Time14.76s (± 0.33%)14.75s (± 0.25%)-0.02s (- 0.12%)14.68s14.82s
Compiler-Unions - node (v10.16.3, x64)
Memory used205,960k (± 0.04%)205,971k (± 0.04%)+12k (+ 0.01%)205,784k206,193k
Parse Time0.84s (± 0.53%)0.84s (± 0.69%)+0.00s (+ 0.12%)0.83s0.85s
Bind Time0.51s (± 0.66%)0.51s (± 0.78%)-0.00s (- 0.39%)0.50s0.52s
Check Time7.92s (± 0.71%)7.89s (± 0.51%)-0.03s (- 0.38%)7.84s8.01s
Emit Time2.49s (± 1.04%)2.48s (± 0.64%)-0.01s (- 0.28%)2.45s2.52s
Total Time11.77s (± 0.47%)11.73s (± 0.35%)-0.04s (- 0.33%)11.66s11.85s
Monaco - node (v10.16.3, x64)
Memory used343,793k (± 0.03%)343,787k (± 0.02%)-7k (- 0.00%)343,662k343,891k
Parse Time1.57s (± 0.42%)1.58s (± 0.47%)+0.01s (+ 0.64%)1.56s1.59s
Bind Time0.76s (± 0.48%)0.76s (± 0.81%)+0.00s (+ 0.40%)0.74s0.77s
Check Time5.77s (± 0.63%)5.79s (± 0.38%)+0.02s (+ 0.38%)5.75s5.86s
Emit Time3.23s (± 0.59%)3.22s (± 0.53%)-0.01s (- 0.25%)3.19s3.28s
Total Time11.33s (± 0.38%)11.35s (± 0.22%)+0.03s (+ 0.23%)11.32s11.43s
TFS - node (v10.16.3, x64)
Memory used305,380k (± 0.03%)305,406k (± 0.04%)+26k (+ 0.01%)305,229k305,709k
Parse Time1.29s (± 0.46%)1.29s (± 0.58%)+0.00s (+ 0.08%)1.27s1.31s
Bind Time0.72s (± 0.69%)0.71s (± 1.16%)-0.00s (- 0.14%)0.70s0.74s
Check Time5.25s (± 0.51%)5.25s (± 0.30%)-0.00s (- 0.04%)5.22s5.29s
Emit Time3.46s (± 1.61%)3.42s (± 1.03%)-0.04s (- 1.13%)3.35s3.50s
Total Time10.71s (± 0.56%)10.67s (± 0.28%)-0.04s (- 0.41%)10.61s10.76s
material-ui - node (v10.16.3, x64)
Memory used470,483k (± 0.01%)470,499k (± 0.01%)+16k (+ 0.00%)470,337k470,551k
Parse Time1.81s (± 0.40%)1.82s (± 0.38%)+0.01s (+ 0.50%)1.80s1.83s
Bind Time0.68s (± 0.73%)0.67s (± 1.04%)-0.00s (- 0.74%)0.65s0.68s
Check Time14.26s (± 0.52%)14.29s (± 0.41%)+0.03s (+ 0.24%)14.16s14.43s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time16.74s (± 0.46%)16.78s (± 0.37%)+0.04s (+ 0.24%)16.65s16.93s
xstate - node (v10.16.3, x64)
Memory used572,534k (± 0.02%)572,558k (± 0.01%)+24k (+ 0.00%)572,434k572,713k
Parse Time2.57s (± 0.44%)2.58s (± 0.26%)+0.01s (+ 0.23%)2.56s2.59s
Bind Time1.00s (± 0.47%)1.00s (± 0.98%)-0.00s (- 0.10%)0.99s1.03s
Check Time1.52s (± 0.54%)1.52s (± 0.49%)+0.00s (+ 0.20%)1.50s1.54s
Emit Time0.07s (± 0.00%)0.07s (± 3.14%)+0.00s (+ 1.43%)0.07s0.08s
Total Time5.16s (± 0.34%)5.17s (± 0.37%)+0.01s (+ 0.17%)5.12s5.21s
Angular - node (v12.1.0, x64)
Memory used335,197k (± 0.02%)335,181k (± 0.01%)-16k (- 0.00%)335,100k335,301k
Parse Time2.06s (± 0.56%)2.07s (± 0.57%)+0.01s (+ 0.24%)2.05s2.10s
Bind Time0.84s (± 0.69%)0.83s (± 0.72%)-0.01s (- 0.95%)0.82s0.85s
Check Time5.68s (± 0.91%)5.68s (± 0.92%)-0.00s (- 0.07%)5.62s5.87s
Emit Time6.26s (± 0.57%)6.26s (± 0.50%)+0.00s (+ 0.03%)6.18s6.32s
Total Time14.84s (± 0.48%)14.84s (± 0.40%)-0.00s (- 0.02%)14.74s15.02s
Compiler-Unions - node (v12.1.0, x64)
Memory used193,285k (± 0.16%)193,293k (± 0.14%)+8k (+ 0.00%)192,790k193,708k
Parse Time0.84s (± 0.83%)0.85s (± 0.87%)+0.01s (+ 1.07%)0.84s0.87s
Bind Time0.53s (± 0.64%)0.53s (± 0.76%)-0.00s (- 0.75%)0.52s0.54s
Check Time7.45s (± 0.49%)7.40s (± 0.53%)-0.05s (- 0.67%)7.32s7.51s
Emit Time2.58s (± 1.34%)2.57s (± 1.13%)-0.01s (- 0.31%)2.52s2.64s
Total Time11.41s (± 0.48%)11.36s (± 0.41%)-0.05s (- 0.45%)11.25s11.48s
Monaco - node (v12.1.0, x64)
Memory used326,778k (± 0.03%)326,729k (± 0.02%)-49k (- 0.02%)326,576k326,890k
Parse Time1.54s (± 0.94%)1.55s (± 0.77%)+0.01s (+ 0.58%)1.53s1.59s
Bind Time0.74s (± 0.78%)0.74s (± 1.10%)0.00s ( 0.00%)0.73s0.76s
Check Time5.64s (± 0.41%)5.63s (± 0.61%)-0.01s (- 0.23%)5.55s5.71s
Emit Time3.24s (± 0.47%)3.24s (± 0.46%)+0.00s (+ 0.06%)3.22s3.28s
Total Time11.17s (± 0.29%)11.16s (± 0.39%)-0.01s (- 0.07%)11.09s11.28s
TFS - node (v12.1.0, x64)
Memory used290,014k (± 0.02%)290,015k (± 0.02%)+1k (+ 0.00%)289,859k290,083k
Parse Time1.30s (± 0.68%)1.30s (± 0.68%)+0.00s (+ 0.08%)1.28s1.32s
Bind Time0.71s (± 0.48%)0.70s (± 0.68%)-0.01s (- 1.41%)0.69s0.71s
Check Time5.19s (± 0.49%)5.19s (± 0.68%)-0.00s (- 0.10%)5.10s5.26s
Emit Time3.46s (± 0.92%)3.50s (± 0.56%)+0.04s (+ 1.27%)3.47s3.56s
Total Time10.66s (± 0.43%)10.69s (± 0.38%)+0.03s (+ 0.24%)10.59s10.76s
material-ui - node (v12.1.0, x64)
Memory used449,442k (± 0.01%)449,484k (± 0.01%)+42k (+ 0.01%)449,370k449,586k
Parse Time1.81s (± 0.39%)1.82s (± 0.36%)+0.01s (+ 0.61%)1.80s1.83s
Bind Time0.65s (± 0.95%)0.65s (± 0.72%)+0.00s (+ 0.15%)0.64s0.66s
Check Time12.84s (± 0.41%)12.83s (± 0.27%)-0.01s (- 0.04%)12.76s12.91s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.30s (± 0.32%)15.30s (± 0.23%)+0.00s (+ 0.03%)15.24s15.38s
xstate - node (v12.1.0, x64)
Memory used538,108k (± 0.02%)538,126k (± 0.02%)+18k (+ 0.00%)537,876k538,265k
Parse Time2.52s (± 0.26%)2.53s (± 0.82%)+0.00s (+ 0.20%)2.49s2.59s
Bind Time1.03s (± 0.60%)1.03s (± 0.56%)+0.00s (+ 0.19%)1.02s1.05s
Check Time1.46s (± 0.33%)1.47s (± 0.64%)+0.01s (+ 0.48%)1.45s1.50s
Emit Time0.07s (± 0.00%)0.07s (± 0.00%)0.00s ( 0.00%)0.07s0.07s
Total Time5.09s (± 0.22%)5.10s (± 0.48%)+0.02s (+ 0.31%)5.05s5.17s
Angular - node (v14.15.1, x64)
Memory used333,430k (± 0.01%)333,444k (± 0.01%)+14k (+ 0.00%)333,357k333,494k
Parse Time2.03s (± 0.44%)2.03s (± 0.58%)+0.00s (+ 0.10%)2.01s2.06s
Bind Time0.88s (± 0.66%)0.87s (± 0.56%)-0.00s (- 0.34%)0.87s0.89s
Check Time5.65s (± 0.59%)5.63s (± 0.58%)-0.01s (- 0.21%)5.57s5.68s
Emit Time6.33s (± 0.55%)6.29s (± 0.67%)-0.03s (- 0.52%)6.23s6.42s
Total Time14.88s (± 0.33%)14.83s (± 0.43%)-0.05s (- 0.33%)14.71s14.99s
Compiler-Unions - node (v14.15.1, x64)
Memory used192,201k (± 0.02%)192,190k (± 0.01%)-11k (- 0.01%)192,157k192,240k
Parse Time0.85s (± 0.78%)0.86s (± 0.77%)+0.01s (+ 0.82%)0.85s0.87s
Bind Time0.56s (± 0.71%)0.56s (± 0.72%)-0.00s (- 0.36%)0.55s0.57s
Check Time7.47s (± 0.49%)7.49s (± 0.35%)+0.02s (+ 0.27%)7.43s7.57s
Emit Time2.51s (± 0.92%)2.50s (± 0.59%)-0.01s (- 0.60%)2.46s2.54s
Total Time11.40s (± 0.32%)11.41s (± 0.31%)+0.01s (+ 0.12%)11.35s11.51s
Monaco - node (v14.15.1, x64)
Memory used325,525k (± 0.01%)325,513k (± 0.01%)-12k (- 0.00%)325,471k325,552k
Parse Time1.57s (± 0.67%)1.58s (± 0.60%)+0.01s (+ 0.64%)1.56s1.60s
Bind Time0.77s (± 0.47%)0.77s (± 0.94%)-0.00s (- 0.26%)0.75s0.79s
Check Time5.55s (± 0.48%)5.54s (± 0.46%)-0.01s (- 0.23%)5.49s5.60s
Emit Time3.34s (± 0.89%)3.32s (± 0.52%)-0.01s (- 0.39%)3.29s3.37s
Total Time11.23s (± 0.50%)11.21s (± 0.22%)-0.02s (- 0.16%)11.18s11.29s
TFS - node (v14.15.1, x64)
Memory used289,052k (± 0.00%)289,074k (± 0.01%)+22k (+ 0.01%)289,044k289,112k
Parse Time1.35s (± 0.89%)1.35s (± 0.41%)-0.00s (- 0.15%)1.34s1.37s
Bind Time0.72s (± 1.15%)0.74s (± 1.64%)+0.01s (+ 1.38%)0.71s0.77s
Check Time5.20s (± 0.49%)5.19s (± 0.56%)-0.01s (- 0.21%)5.13s5.28s
Emit Time3.57s (± 1.51%)3.52s (± 2.10%)-0.05s (- 1.37%)3.38s3.66s
Total Time10.85s (± 0.71%)10.80s (± 0.57%)-0.05s (- 0.45%)10.68s10.95s
material-ui - node (v14.15.1, x64)
Memory used447,797k (± 0.00%)447,712k (± 0.04%)-84k (- 0.02%)447,039k447,816k
Parse Time1.87s (± 0.51%)1.87s (± 0.41%)+0.00s (+ 0.16%)1.85s1.88s
Bind Time0.70s (± 0.85%)0.69s (± 0.48%)-0.01s (- 0.86%)0.68s0.70s
Check Time12.96s (± 0.36%)13.01s (± 0.57%)+0.05s (+ 0.37%)12.87s13.23s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.52s (± 0.30%)15.57s (± 0.47%)+0.05s (+ 0.30%)15.41s15.77s
xstate - node (v14.15.1, x64)
Memory used535,911k (± 0.00%)535,905k (± 0.01%)-6k (- 0.00%)535,840k535,975k
Parse Time2.59s (± 0.36%)2.58s (± 0.39%)-0.01s (- 0.35%)2.56s2.61s
Bind Time1.14s (± 0.57%)1.15s (± 1.37%)+0.01s (+ 0.61%)1.13s1.21s
Check Time1.51s (± 0.32%)1.50s (± 0.45%)-0.00s (- 0.20%)1.49s1.52s
Emit Time0.07s (± 0.00%)0.07s (± 0.00%)0.00s ( 0.00%)0.07s0.07s
Total Time5.32s (± 0.24%)5.31s (± 0.35%)-0.01s (- 0.17%)5.28s5.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)
BenchmarkNameIterations
Current4886110
Baselinemain10

Developer Information:

Download Benchmark

Comment threadsrc/compiler/checker.ts Outdated
@weswigham

Copy link
Copy Markdown
MemberAuthor

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

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

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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
Copy Markdown
Contributor

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

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

Hey Wesley Wigham (@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
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
The results of the perf run you requested are in!

Here they are:

Comparison Report - main..48861

Metricmain48861DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used357,484k (± 0.03%)357,454k (± 0.01%)-30k (- 0.01%)357,371k357,550k
Parse Time2.07s (± 0.36%)2.06s (± 0.59%)-0.00s (- 0.10%)2.04s2.09s
Bind Time0.87s (± 1.80%)0.86s (± 0.60%)-0.01s (- 0.69%)0.85s0.87s
Check Time5.85s (± 0.62%)5.85s (± 0.49%)-0.01s (- 0.10%)5.78s5.91s
Emit Time6.02s (± 1.03%)6.03s (± 0.77%)+0.00s (+ 0.05%)5.94s6.11s
Total Time14.81s (± 0.54%)14.80s (± 0.39%)-0.01s (- 0.07%)14.66s14.93s
Compiler-Unions - node (v10.16.3, x64)
Memory used205,991k (± 0.02%)205,912k (± 0.02%)-79k (- 0.04%)205,816k206,002k
Parse Time0.84s (± 0.66%)0.84s (± 0.44%)+0.00s (+ 0.36%)0.84s0.85s
Bind Time0.51s (± 0.71%)0.51s (± 0.66%)-0.00s (- 0.19%)0.51s0.52s
Check Time7.89s (± 0.67%)7.93s (± 0.72%)+0.04s (+ 0.52%)7.84s8.07s
Emit Time2.51s (± 1.14%)2.49s (± 1.07%)-0.02s (- 0.84%)2.43s2.56s
Total Time11.76s (± 0.58%)11.78s (± 0.58%)+0.02s (+ 0.20%)11.67s11.94s
Monaco - node (v10.16.3, x64)
Memory used343,771k (± 0.01%)343,782k (± 0.02%)+12k (+ 0.00%)343,624k343,904k
Parse Time1.58s (± 0.31%)1.58s (± 0.47%)+0.00s (+ 0.06%)1.56s1.59s
Bind Time0.76s (± 0.58%)0.76s (± 0.76%)-0.00s (- 0.26%)0.75s0.77s
Check Time5.82s (± 0.46%)5.82s (± 0.28%)+0.00s (+ 0.07%)5.78s5.87s
Emit Time3.26s (± 0.37%)3.25s (± 0.65%)-0.01s (- 0.34%)3.21s3.30s
Total Time11.42s (± 0.27%)11.41s (± 0.33%)-0.01s (- 0.11%)11.32s11.52s
TFS - node (v10.16.3, x64)
Memory used305,361k (± 0.03%)305,414k (± 0.02%)+53k (+ 0.02%)305,315k305,633k
Parse Time1.29s (± 0.72%)1.29s (± 0.43%)-0.00s (- 0.00%)1.28s1.30s
Bind Time0.72s (± 1.03%)0.72s (± 0.84%)-0.00s (- 0.69%)0.70s0.73s
Check Time5.26s (± 0.62%)5.23s (± 0.53%)-0.03s (- 0.51%)5.18s5.31s
Emit Time3.47s (± 1.11%)3.42s (± 1.34%)-0.05s (- 1.50%)3.34s3.51s
Total Time10.74s (± 0.61%)10.65s (± 0.55%)-0.08s (- 0.78%)10.54s10.80s
material-ui - node (v10.16.3, x64)
Memory used470,463k (± 0.01%)470,445k (± 0.01%)-18k (- 0.00%)470,292k470,552k
Parse Time1.82s (± 0.33%)1.82s (± 0.42%)-0.01s (- 0.49%)1.80s1.83s
Bind Time0.68s (± 0.86%)0.68s (± 1.03%)+0.00s (+ 0.59%)0.67s0.70s
Check Time14.33s (± 0.86%)14.29s (± 0.62%)-0.05s (- 0.35%)14.20s14.62s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time16.84s (± 0.73%)16.78s (± 0.58%)-0.05s (- 0.33%)16.69s17.15s
xstate - node (v10.16.3, x64)
Memory used575,853k (± 1.24%)579,034k (± 1.65%)+3,181k (+ 0.55%)572,498k604,775k
Parse Time2.59s (± 0.50%)2.58s (± 0.31%)-0.01s (- 0.27%)2.57s2.60s
Bind Time1.01s (± 0.77%)1.01s (± 0.59%)-0.00s (- 0.49%)0.99s1.02s
Check Time1.52s (± 0.55%)1.52s (± 0.58%)-0.00s (- 0.07%)1.49s1.54s
Emit Time0.07s (± 3.14%)0.07s (± 0.00%)-0.00s (- 1.41%)0.07s0.07s
Total Time5.19s (± 0.33%)5.18s (± 0.19%)-0.01s (- 0.25%)5.16s5.20s
Angular - node (v12.1.0, x64)
Memory used335,194k (± 0.01%)335,241k (± 0.02%)+47k (+ 0.01%)335,052k335,488k
Parse Time2.08s (± 0.41%)2.07s (± 0.54%)-0.01s (- 0.38%)2.04s2.09s
Bind Time0.84s (± 0.77%)0.84s (± 0.48%)-0.00s (- 0.12%)0.83s0.85s
Check Time5.66s (± 0.51%)5.65s (± 0.51%)-0.01s (- 0.23%)5.56s5.70s
Emit Time6.30s (± 0.54%)6.26s (± 0.76%)-0.04s (- 0.65%)6.16s6.36s
Total Time14.88s (± 0.37%)14.82s (± 0.42%)-0.06s (- 0.42%)14.70s14.97s
Compiler-Unions - node (v12.1.0, x64)
Memory used193,099k (± 0.31%)193,229k (± 0.14%)+130k (+ 0.07%)192,529k193,662k
Parse Time0.85s (± 1.83%)0.84s (± 1.26%)-0.01s (- 0.94%)0.82s0.87s
Bind Time0.54s (± 0.89%)0.54s (± 0.92%)-0.00s (- 0.19%)0.53s0.55s
Check Time7.42s (± 0.63%)7.43s (± 0.76%)+0.01s (+ 0.18%)7.36s7.58s
Emit Time2.57s (± 1.32%)2.57s (± 1.29%)+0.00s (+ 0.12%)2.50s2.65s
Total Time11.38s (± 0.56%)11.39s (± 0.69%)+0.01s (+ 0.09%)11.25s11.60s
Monaco - node (v12.1.0, x64)
Memory used326,742k (± 0.02%)326,720k (± 0.02%)-22k (- 0.01%)326,553k326,833k
Parse Time1.56s (± 0.89%)1.55s (± 0.79%)-0.01s (- 0.58%)1.53s1.59s
Bind Time0.74s (± 0.83%)0.74s (± 0.60%)+0.00s (+ 0.41%)0.73s0.75s
Check Time5.65s (± 0.53%)5.65s (± 0.47%)+0.00s (+ 0.00%)5.60s5.70s
Emit Time3.27s (± 1.17%)3.26s (± 0.87%)-0.01s (- 0.43%)3.20s3.33s
Total Time11.22s (± 0.44%)11.20s (± 0.47%)-0.02s (- 0.19%)11.11s11.31s
TFS - node (v12.1.0, x64)
Memory used290,007k (± 0.02%)290,073k (± 0.02%)+66k (+ 0.02%)289,915k290,204k
Parse Time1.31s (± 0.45%)1.31s (± 0.72%)+0.00s (+ 0.08%)1.29s1.32s
Bind Time0.70s (± 1.42%)0.70s (± 0.80%)-0.01s (- 0.71%)0.69s0.71s
Check Time5.19s (± 0.30%)5.18s (± 0.29%)-0.00s (- 0.08%)5.15s5.21s
Emit Time3.49s (± 1.03%)3.50s (± 0.89%)+0.01s (+ 0.20%)3.41s3.58s
Total Time10.69s (± 0.42%)10.68s (± 0.37%)-0.00s (- 0.03%)10.60s10.78s
material-ui - node (v12.1.0, x64)
Memory used449,343k (± 0.07%)449,373k (± 0.05%)+31k (+ 0.01%)448,434k449,663k
Parse Time1.83s (± 0.66%)1.82s (± 0.45%)-0.01s (- 0.38%)1.80s1.84s
Bind Time0.65s (± 0.91%)0.65s (± 0.85%)-0.00s (- 0.31%)0.64s0.67s
Check Time13.01s (± 1.03%)12.93s (± 0.69%)-0.08s (- 0.61%)12.79s13.22s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.49s (± 0.92%)15.40s (± 0.59%)-0.09s (- 0.56%)15.26s15.68s
xstate - node (v12.1.0, x64)
Memory used538,166k (± 0.01%)538,238k (± 0.02%)+73k (+ 0.01%)538,038k538,501k
Parse Time2.53s (± 0.52%)2.55s (± 0.45%)+0.02s (+ 0.63%)2.53s2.58s
Bind Time1.03s (± 0.36%)1.04s (± 0.66%)+0.00s (+ 0.10%)1.02s1.05s
Check Time1.47s (± 0.69%)1.48s (± 0.63%)+0.01s (+ 0.48%)1.46s1.50s
Emit Time0.07s (± 0.00%)0.07s (± 0.00%)0.00s ( 0.00%)0.07s0.07s
Total Time5.11s (± 0.19%)5.13s (± 0.40%)+0.02s (+ 0.47%)5.09s5.17s
Angular - node (v14.15.1, x64)
Memory used333,413k (± 0.01%)333,430k (± 0.01%)+17k (+ 0.01%)333,386k333,459k
Parse Time2.05s (± 0.51%)2.03s (± 0.36%)-0.02s (- 1.17%)2.01s2.04s
Bind Time0.88s (± 0.56%)0.88s (± 0.56%)0.00s ( 0.00%)0.87s0.89s
Check Time5.64s (± 0.59%)5.62s (± 0.40%)-0.02s (- 0.34%)5.57s5.69s
Emit Time6.35s (± 0.75%)6.29s (± 0.71%)-0.06s (- 0.91%)6.21s6.43s
Total Time14.92s (± 0.46%)14.82s (± 0.37%)-0.10s (- 0.70%)14.70s14.94s
Compiler-Unions - node (v14.15.1, x64)
Memory used192,179k (± 0.02%)192,154k (± 0.09%)-25k (- 0.01%)191,487k192,302k
Parse Time0.86s (± 0.68%)0.86s (± 0.85%)+0.00s (+ 0.12%)0.84s0.87s
Bind Time0.56s (± 0.84%)0.56s (± 0.65%)+0.00s (+ 0.18%)0.56s0.57s
Check Time7.54s (± 0.48%)7.54s (± 0.80%)+0.00s (+ 0.05%)7.42s7.65s
Emit Time2.51s (± 0.50%)2.52s (± 0.81%)+0.01s (+ 0.40%)2.49s2.59s
Total Time11.46s (± 0.43%)11.48s (± 0.58%)+0.02s (+ 0.16%)11.34s11.59s
Monaco - node (v14.15.1, x64)
Memory used325,489k (± 0.01%)325,525k (± 0.01%)+36k (+ 0.01%)325,462k325,610k
Parse Time1.58s (± 1.15%)1.56s (± 0.44%)-0.02s (- 1.20%)1.55s1.58s
Bind Time0.77s (± 0.75%)0.77s (± 0.58%)-0.00s (- 0.13%)0.76s0.78s
Check Time5.56s (± 0.27%)5.56s (± 0.36%)+0.00s (+ 0.05%)5.51s5.60s
Emit Time3.31s (± 0.79%)3.34s (± 0.48%)+0.02s (+ 0.75%)3.30s3.37s
Total Time11.22s (± 0.28%)11.24s (± 0.30%)+0.01s (+ 0.09%)11.14s11.31s
TFS - node (v14.15.1, x64)
Memory used289,079k (± 0.01%)289,067k (± 0.01%)-12k (- 0.00%)288,994k289,128k
Parse Time1.37s (± 0.61%)1.36s (± 0.75%)-0.00s (- 0.37%)1.35s1.40s
Bind Time0.72s (± 0.47%)0.72s (± 0.47%)0.00s ( 0.00%)0.72s0.73s
Check Time5.19s (± 0.15%)5.20s (± 0.35%)+0.01s (+ 0.25%)5.16s5.24s
Emit Time3.55s (± 2.36%)3.49s (± 1.89%)-0.06s (- 1.58%)3.38s3.61s
Total Time10.82s (± 0.80%)10.78s (± 0.63%)-0.05s (- 0.43%)10.63s10.88s
material-ui - node (v14.15.1, x64)
Memory used447,805k (± 0.01%)447,814k (± 0.00%)+9k (+ 0.00%)447,755k447,844k
Parse Time1.88s (± 0.32%)1.88s (± 0.59%)-0.00s (- 0.05%)1.85s1.90s
Bind Time0.70s (± 0.71%)0.70s (± 0.52%)-0.00s (- 0.00%)0.69s0.70s
Check Time13.03s (± 0.60%)13.01s (± 0.47%)-0.01s (- 0.11%)12.88s13.17s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.60s (± 0.50%)15.58s (± 0.40%)-0.02s (- 0.11%)15.45s15.73s
xstate - node (v14.15.1, x64)
Memory used535,894k (± 0.00%)535,906k (± 0.00%)+12k (+ 0.00%)535,870k535,968k
Parse Time2.60s (± 0.70%)2.60s (± 0.55%)-0.00s (- 0.08%)2.56s2.63s
Bind Time1.15s (± 0.73%)1.15s (± 0.67%)-0.00s (- 0.00%)1.13s1.17s
Check Time1.51s (± 0.41%)1.51s (± 0.39%)-0.00s (- 0.20%)1.50s1.52s
Emit Time0.07s (± 0.00%)0.07s (± 0.00%)0.00s ( 0.00%)0.07s0.07s
Total Time5.33s (± 0.46%)5.32s (± 0.31%)-0.01s (- 0.24%)5.26s5.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)
BenchmarkNameIterations
Current4886110
Baselinemain10

Developer Information:

Download Benchmark

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

Anders Hejlsberg (@ahejlsberg) do you feel comfortable with us bringing this in?

@weswigham
Wesley Wigham (weswigham) merged commit f84ec3e into microsoft:mainMay 9, 2022
@weswigham

Copy link
Copy Markdown
MemberAuthor

Daniel Rosenwasser (@DanielRosenwasser) do you still want to cherry pick this for 4.7?

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Milestone BugPRs 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

6 participants

@weswigham@typescript-bot@DanielRosenwasser@ahejlsberg@Andarist@sandersn