Skip to content

Improve excess property checking for intersections - #32582

Merged
Nathan Shively-Sanders (sandersn) merged 5 commits into
masterfrom
excess-property-check-nested-array-intersection
Aug 6, 2019
Merged

Improve excess property checking for intersections#32582
Nathan Shively-Sanders (sandersn) merged 5 commits into
masterfrom
excess-property-check-nested-array-intersection

Conversation

@sandersn

Copy link
Copy Markdown
Member

Excess property checking incorrectly applies to half of an intersection when nested deeply enough because isIntersectionConstituent is not sufficiently threaded through the checkTypeRelatedTo code. This PR threads isIntersectionConstituent through several more places.

I may scope isIntersectionConstituent to the entirety of checkTypeRelatedTo and mutate it in a dynamically scoped way. The fix works as-is, but I think it would be simpler to mutate a variable instead of adding parameters.

Fixes#30715

Still a draft, the implementation needs improvement
This makes parameter lists a lot shorter. Seems like a slight
improvement, although I can revert if I change my mind.
@sandersn

Copy link
Copy Markdown
MemberAuthor

I think that using a mutable isIntersection in checkTypeRelatedTo is easier to read than extending the parameter lists yet again, but I can revert that commit if needed.

(Assigned to Wesley Wigham (@weswigham) instead of requesting since the requested reviewers list is broken.)

Comment threadsrc/compiler/checker.ts Outdated
else {
// Only here do we need to check that the initializer is assignable to the enum type.
checkTypeAssignableTo(checkExpression(initializer), getDeclaredTypeOfSymbol(getSymbolOfNode(member.parent)), initializer, /*headMessage*/ undefined);
checkTypeAssignableTo(checkExpression(initializer), getDeclaredTypeOfSymbol(getSymbolOfNode(member.parent)), initializer);

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.

??? Why was the parameter removed here? AFAIK passing /*headMessage*/ undefined disables error reporting, no?

@sandersnNathan Shively-Sanders (sandersn)Aug 5, 2019

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.

not passing it also disables error reporting. I ran a cleanup regex and it applied to this usage too. If you want to keep it to help readability, I can put it back.

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.

Nah, it's fine.

}
}
else if (target.flags & TypeFlags.Intersection) {
isIntersectionConstituent = true; // set here to affect the following trio of checks

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.

So this affected the recursiveTypeRelatedTo call after this else if block (if the contents of the block did not cause a return) before (the third check of the trio referenced in the comment), but now nothing does. Was the change intentional?

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.

I think so (the intervening vacation makes things a bit fuzzy). I think I decided it could be dispensed with entirely because isIntersectionConstituent is now set in typeRelatedToEachType (line 13152) instead of here. But it may be there is a difference and that our tests just don't catch it.

In any case, after leaving this PR for a while, I kind of like the threaded-parameter approach. I'm going to measure performance on both commits to make sure that there are no weird limits on parameter count in the VM and go back to explicit parameters if there's no perf difference.

@sandersn

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 6, 2019

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the perf test suite on this PR at 74113b3. You can monitor the build here. It should now contribute to this PR's status checks.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn)
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..32582

Metricmaster32582DeltaBestWorst
Angular - node (v12.1.0, x64)
Memory used325,374k (± 0.02%)318,377k (± 0.02%)-6,997k (- 2.15%)318,271k318,579k
Parse Time1.44s (± 0.77%)1.40s (± 0.57%)-0.05s (- 3.25%)1.38s1.42s
Bind Time0.76s (± 1.16%)0.74s (± 0.81%)-0.02s (- 3.29%)0.72s0.75s
Check Time4.20s (± 0.50%)4.18s (± 0.50%)-0.02s (- 0.48%)4.14s4.23s
Emit Time5.22s (± 0.62%)5.27s (± 0.97%)+0.05s (+ 0.98%)5.17s5.41s
Total Time11.63s (± 0.42%)11.59s (± 0.40%)-0.04s (- 0.35%)11.47s11.71s
Monaco - node (v12.1.0, x64)
Memory used345,801k (± 0.02%)345,769k (± 0.02%)-32k (- 0.01%)345,600k345,926k
Parse Time1.19s (± 0.57%)1.19s (± 0.54%)-0.00s (- 0.25%)1.18s1.21s
Bind Time0.68s (± 0.86%)0.67s (± 0.66%)-0.01s (- 0.74%)0.66s0.68s
Check Time4.27s (± 0.59%)4.24s (± 0.55%)-0.03s (- 0.61%)4.20s4.30s
Emit Time2.85s (± 0.77%)2.86s (± 0.59%)+0.01s (+ 0.46%)2.83s2.91s
Total Time8.98s (± 0.44%)8.96s (± 0.39%)-0.02s (- 0.24%)8.90s9.04s
TFS - node (v12.1.0, x64)
Memory used301,433k (± 0.01%)301,271k (± 0.01%)-162k (- 0.05%)301,174k301,365k
Parse Time0.93s (± 0.91%)0.91s (± 0.63%)-0.02s (- 2.26%)0.90s0.92s
Bind Time0.63s (± 0.80%)0.62s (± 1.07%)-0.01s (- 0.80%)0.61s0.64s
Check Time3.86s (± 0.55%)3.79s (± 0.39%)-0.07s (- 1.86%)3.75s3.82s
Emit Time2.98s (± 0.44%)2.96s (± 0.87%)-0.02s (- 0.57%)2.88s3.00s
Total Time8.39s (± 0.35%)8.28s (± 0.42%)-0.11s (- 1.32%)8.18s8.34s
Angular - node (v8.9.0, x64)
Memory used343,971k (± 0.02%)336,854k (± 0.02%)-7,117k (- 2.07%)336,704k337,034k
Parse Time1.92s (± 0.23%)1.79s (± 0.41%)-0.13s (- 6.97%)1.77s1.80s
Bind Time0.82s (± 0.82%)0.80s (± 0.81%)-0.02s (- 1.84%)0.79s0.82s
Check Time5.00s (± 0.68%)5.00s (± 1.42%)-0.01s (- 0.14%)4.81s5.15s
Emit Time6.07s (± 0.62%)6.09s (± 1.51%)+0.02s (+ 0.26%)5.92s6.32s
Total Time13.82s (± 0.29%)13.67s (± 0.62%)-0.14s (- 1.04%)13.44s13.81s
Monaco - node (v8.9.0, x64)
Memory used363,313k (± 0.01%)363,160k (± 0.02%)-153k (- 0.04%)363,026k363,269k
Parse Time1.53s (± 0.45%)1.43s (± 0.40%)-0.09s (- 6.09%)1.42s1.44s
Bind Time0.88s (± 0.51%)0.90s (± 1.67%)+0.01s (+ 1.59%)0.88s0.93s
Check Time5.26s (± 0.54%)5.18s (± 1.52%)-0.08s (- 1.50%)5.04s5.34s
Emit Time2.94s (± 0.52%)3.16s (± 6.46%)+0.22s (+ 7.53%)2.91s3.50s
Total Time10.61s (± 0.35%)10.67s (± 1.38%)+0.06s (+ 0.58%)10.46s10.93s
TFS - node (v8.9.0, x64)
Memory used317,300k (± 0.01%)317,069k (± 0.02%)-231k (- 0.07%)316,969k317,172k
Parse Time1.23s (± 0.57%)1.14s (± 0.89%)-0.09s (- 7.31%)1.12s1.17s
Bind Time0.66s (± 0.45%)0.67s (± 0.86%)+0.01s (+ 1.21%)0.66s0.69s
Check Time4.50s (± 0.67%)4.47s (± 0.59%)-0.02s (- 0.53%)4.41s4.54s
Emit Time3.06s (± 0.36%)3.21s (± 2.61%)+0.14s (+ 4.67%)2.94s3.30s
Total Time9.46s (± 0.36%)9.49s (± 0.90%)+0.03s (+ 0.36%)9.23s9.62s
Angular - node (v8.9.0, x86)
Memory used194,845k (± 0.02%)190,864k (± 0.03%)-3,981k (- 2.04%)190,747k190,991k
Parse Time1.87s (± 0.69%)1.74s (± 0.49%)-0.13s (- 7.15%)1.72s1.76s
Bind Time0.95s (± 0.63%)0.95s (± 0.98%)-0.01s (- 0.73%)0.93s0.98s
Check Time4.58s (± 0.51%)4.54s (± 0.69%)-0.05s (- 1.05%)4.47s4.61s
Emit Time5.81s (± 1.18%)5.82s (± 0.89%)+0.01s (+ 0.15%)5.67s5.93s
Total Time13.22s (± 0.60%)13.04s (± 0.42%)-0.18s (- 1.37%)12.90s13.14s
Monaco - node (v8.9.0, x86)
Memory used202,915k (± 0.02%)202,750k (± 0.02%)-164k (- 0.08%)202,662k202,849k
Parse Time1.59s (± 0.37%)1.49s (± 0.87%)-0.09s (- 5.80%)1.48s1.53s
Bind Time0.71s (± 0.71%)0.72s (± 0.56%)+0.01s (+ 1.99%)0.71s0.73s
Check Time4.86s (± 0.61%)4.83s (± 0.46%)-0.03s (- 0.56%)4.78s4.88s
Emit Time3.18s (± 0.33%)3.18s (± 0.58%)-0.01s (- 0.16%)3.13s3.22s
Total Time10.33s (± 0.33%)10.23s (± 0.38%)-0.10s (- 1.02%)10.12s10.29s
TFS - node (v8.9.0, x86)
Memory used178,235k (± 0.02%)178,129k (± 0.02%)-107k (- 0.06%)178,084k178,213k
Parse Time1.30s (± 0.47%)1.19s (± 0.95%)-0.11s (- 8.47%)1.17s1.21s
Bind Time0.63s (± 0.95%)0.63s (± 0.75%)+0.01s (+ 1.12%)0.63s0.65s
Check Time4.30s (± 0.53%)4.26s (± 0.46%)-0.04s (- 1.00%)4.22s4.32s
Emit Time2.86s (± 0.42%)2.86s (± 1.33%)-0.00s (- 0.07%)2.76s2.97s
Total Time9.08s (± 0.24%)8.93s (± 0.57%)-0.15s (- 1.67%)8.80s9.08s
Angular - node (v9.0.0, x64)
Memory used343,578k (± 0.02%)336,472k (± 0.02%)-7,106k (- 2.07%)336,392k336,601k
Parse Time1.68s (± 0.66%)1.63s (± 0.36%)-0.06s (- 3.33%)1.62s1.64s
Bind Time0.77s (± 0.52%)0.75s (± 0.89%)-0.02s (- 3.11%)0.73s0.76s
Check Time4.79s (± 0.75%)4.53s (± 0.64%)-0.26s (- 5.39%)4.49s4.62s
Emit Time5.72s (± 1.77%)5.89s (± 1.95%)+0.17s (+ 2.94%)5.72s6.09s
Total Time12.97s (± 1.02%)12.79s (± 1.03%)-0.17s (- 1.33%)12.56s13.02s
Monaco - node (v9.0.0, x64)
Memory used363,409k (± 0.03%)362,968k (± 0.03%)-441k (- 0.12%)362,720k363,176k
Parse Time1.30s (± 0.71%)1.28s (± 0.93%)-0.02s (- 1.23%)1.26s1.31s
Bind Time0.86s (± 1.18%)0.86s (± 0.58%)+0.00s (+ 0.00%)0.84s0.86s
Check Time4.92s (± 1.25%)4.90s (± 0.54%)-0.02s (- 0.35%)4.85s4.95s
Emit Time3.32s (± 3.51%)3.38s (± 0.54%)+0.07s (+ 1.99%)3.35s3.43s
Total Time10.39s (± 0.71%)10.43s (± 0.41%)+0.04s (+ 0.34%)10.36s10.51s
TFS - node (v9.0.0, x64)
Memory used317,317k (± 0.01%)316,857k (± 0.02%)-460k (- 0.14%)316,763k316,993k
Parse Time1.02s (± 0.69%)1.02s (± 0.66%)-0.00s (- 0.20%)1.00s1.03s
Bind Time0.62s (± 0.76%)0.61s (± 0.85%)-0.01s (- 1.45%)0.60s0.62s
Check Time4.37s (± 0.44%)4.33s (± 0.69%)-0.04s (- 0.89%)4.29s4.43s
Emit Time3.19s (± 1.03%)3.20s (± 0.67%)+0.02s (+ 0.53%)3.15s3.25s
Total Time9.20s (± 0.45%)9.16s (± 0.55%)-0.03s (- 0.35%)9.06s9.33s
Angular - node (v9.0.0, x86)
Memory used194,960k (± 0.02%)190,887k (± 0.02%)-4,073k (- 2.09%)190,811k191,033k
Parse Time1.60s (± 0.60%)1.54s (± 0.68%)-0.06s (- 3.81%)1.52s1.56s
Bind Time0.88s (± 0.54%)0.88s (± 0.86%)-0.01s (- 0.79%)0.87s0.90s
Check Time4.27s (± 0.77%)4.21s (± 0.57%)-0.06s (- 1.45%)4.16s4.28s
Emit Time5.51s (± 1.12%)5.54s (± 0.84%)+0.03s (+ 0.56%)5.43s5.63s
Total Time12.26s (± 0.53%)12.17s (± 0.50%)-0.10s (- 0.77%)12.01s12.30s
Monaco - node (v9.0.0, x86)
Memory used203,073k (± 0.02%)202,783k (± 0.03%)-289k (- 0.14%)202,661k202,914k
Parse Time1.32s (± 0.49%)1.31s (± 0.49%)-0.01s (- 0.76%)1.29s1.32s
Bind Time0.64s (± 0.58%)0.64s (± 0.76%)-0.00s (- 0.16%)0.64s0.66s
Check Time4.68s (± 0.39%)4.67s (± 0.53%)-0.01s (- 0.21%)4.62s4.73s
Emit Time3.09s (± 0.40%)3.11s (± 0.77%)+0.02s (+ 0.52%)3.07s3.17s
Total Time9.75s (± 0.26%)9.74s (± 0.44%)-0.01s (- 0.07%)9.65s9.82s
TFS - node (v9.0.0, x86)
Memory used178,423k (± 0.02%)178,111k (± 0.02%)-312k (- 0.17%)178,011k178,210k
Parse Time1.04s (± 0.64%)1.03s (± 0.75%)-0.01s (- 1.06%)1.01s1.04s
Bind Time0.58s (± 1.31%)0.58s (± 0.90%)+0.00s (+ 0.52%)0.57s0.59s
Check Time4.15s (± 0.72%)4.12s (± 0.75%)-0.03s (- 0.82%)4.03s4.18s
Emit Time2.79s (± 0.52%)2.81s (± 1.65%)+0.02s (+ 0.72%)2.71s2.95s
Total Time8.55s (± 0.40%)8.53s (± 0.58%)-0.02s (- 0.20%)8.45s8.66s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-142-generic
Architecturex64
Available Memory16 GB
Available Memory1 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
  • node (v9.0.0, x64)
  • node (v9.0.0, x86)
Scenarios
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Angular - node (v9.0.0, x64)
  • Angular - node (v9.0.0, x86)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • Monaco - node (v9.0.0, x64)
  • Monaco - node (v9.0.0, x86)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • TFS - node (v9.0.0, x64)
  • TFS - node (v9.0.0, x86)
BenchmarkNameIterations
Current3258210
Baselinemaster10

@sandersn

Copy link
Copy Markdown
MemberAuthor

OK, I reverted the use of a mutable variable to track isIntersectionConstituent. Now it's back to being a parameter threaded through various functions.

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 6, 2019

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the perf test suite on this PR at b8507d2. You can monitor the build here. It should now contribute to this PR's status checks.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn)
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..32582

Metricmaster32582DeltaBestWorst
Angular - node (v12.1.0, x64)
Memory used325,458k (± 0.02%)318,403k (± 0.01%)-7,055k (- 2.17%)318,340k318,496k
Parse Time1.45s (± 0.67%)1.39s (± 0.53%)-0.06s (- 4.20%)1.38s1.41s
Bind Time0.76s (± 0.90%)0.74s (± 0.40%)-0.02s (- 2.38%)0.73s0.74s
Check Time4.23s (± 0.42%)4.21s (± 0.47%)-0.01s (- 0.31%)4.17s4.25s
Emit Time5.26s (± 0.76%)5.25s (± 0.25%)-0.01s (- 0.25%)5.22s5.27s
Total Time11.70s (± 0.47%)11.59s (± 0.18%)-0.11s (- 0.92%)11.52s11.61s
Monaco - node (v12.1.0, x64)
Memory used345,857k (± 0.01%)345,780k (± 0.02%)-77k (- 0.02%)345,671k345,973k
Parse Time1.19s (± 0.78%)1.18s (± 0.64%)-0.01s (- 0.67%)1.17s1.20s
Bind Time0.68s (± 0.59%)0.68s (± 1.34%)0.00s ( 0.00%)0.67s0.70s
Check Time4.29s (± 0.43%)4.25s (± 0.34%)-0.04s (- 0.98%)4.22s4.28s
Emit Time2.86s (± 0.58%)2.86s (± 0.55%)-0.00s (- 0.07%)2.83s2.90s
Total Time9.02s (± 0.36%)8.97s (± 0.29%)-0.05s (- 0.55%)8.89s9.02s
TFS - node (v12.1.0, x64)
Memory used301,444k (± 0.03%)301,289k (± 0.01%)-156k (- 0.05%)301,158k301,355k
Parse Time0.93s (± 0.91%)0.91s (± 0.90%)-0.02s (- 1.83%)0.90s0.94s
Bind Time0.63s (± 0.75%)0.62s (± 0.84%)-0.01s (- 2.21%)0.61s0.63s
Check Time3.86s (± 0.40%)3.81s (± 0.48%)-0.05s (- 1.19%)3.78s3.86s
Emit Time2.98s (± 0.67%)2.95s (± 0.63%)-0.03s (- 1.11%)2.89s2.98s
Total Time8.40s (± 0.33%)8.30s (± 0.37%)-0.11s (- 1.29%)8.23s8.35s
Angular - node (v8.9.0, x64)
Memory used344,053k (± 0.01%)336,879k (± 0.02%)-7,174k (- 2.09%)336,760k337,025k
Parse Time1.94s (± 0.55%)1.78s (± 0.38%)-0.15s (- 7.85%)1.77s1.80s
Bind Time0.82s (± 0.81%)0.80s (± 0.77%)-0.02s (- 2.67%)0.79s0.81s
Check Time5.03s (± 0.76%)4.96s (± 1.53%)-0.07s (- 1.47%)4.78s5.09s
Emit Time6.05s (± 0.94%)6.16s (± 2.02%)+0.11s (+ 1.82%)5.83s6.38s
Total Time13.84s (± 0.66%)13.70s (± 0.70%)-0.14s (- 1.00%)13.49s13.91s
Monaco - node (v8.9.0, x64)
Memory used363,375k (± 0.01%)363,118k (± 0.01%)-257k (- 0.07%)363,035k363,204k
Parse Time1.53s (± 0.40%)1.44s (± 0.33%)-0.09s (- 5.82%)1.43s1.45s
Bind Time0.88s (± 0.66%)0.89s (± 1.62%)+0.01s (+ 1.13%)0.88s0.93s
Check Time5.32s (± 0.59%)5.23s (± 1.38%)-0.10s (- 1.79%)5.01s5.32s
Emit Time2.94s (± 0.49%)3.04s (± 5.51%)+0.11s (+ 3.64%)2.88s3.50s
Total Time10.67s (± 0.37%)10.60s (± 1.11%)-0.07s (- 0.65%)10.47s10.94s
TFS - node (v8.9.0, x64)
Memory used317,326k (± 0.02%)317,089k (± 0.01%)-237k (- 0.07%)317,011k317,208k
Parse Time1.24s (± 0.67%)1.14s (± 0.51%)-0.09s (- 7.45%)1.13s1.16s
Bind Time0.67s (± 0.78%)0.67s (± 0.74%)-0.00s (- 0.45%)0.66s0.68s
Check Time4.49s (± 0.44%)4.44s (± 0.54%)-0.05s (- 1.11%)4.40s4.50s
Emit Time3.07s (± 0.58%)3.16s (± 2.14%)+0.09s (+ 3.03%)3.04s3.27s
Total Time9.47s (± 0.34%)9.41s (± 0.71%)-0.06s (- 0.58%)9.27s9.54s
Angular - node (v8.9.0, x86)
Memory used194,911k (± 0.02%)190,882k (± 0.04%)-4,030k (- 2.07%)190,701k190,977k
Parse Time1.88s (± 0.37%)1.73s (± 0.42%)-0.15s (- 7.82%)1.72s1.75s
Bind Time0.96s (± 0.98%)0.94s (± 0.77%)-0.02s (- 2.18%)0.93s0.96s
Check Time4.58s (± 0.60%)4.53s (± 0.59%)-0.05s (- 0.98%)4.49s4.61s
Emit Time5.85s (± 1.58%)5.82s (± 1.62%)-0.03s (- 0.50%)5.69s6.15s
Total Time13.27s (± 0.77%)13.03s (± 0.90%)-0.24s (- 1.82%)12.87s13.43s
Monaco - node (v8.9.0, x86)
Memory used202,949k (± 0.02%)202,786k (± 0.02%)-164k (- 0.08%)202,698k202,881k
Parse Time1.60s (± 0.55%)1.50s (± 0.59%)-0.10s (- 6.26%)1.48s1.52s
Bind Time0.71s (± 1.06%)0.72s (± 0.93%)+0.00s (+ 0.42%)0.71s0.74s
Check Time4.88s (± 0.61%)4.84s (± 0.75%)-0.04s (- 0.84%)4.76s4.95s
Emit Time3.20s (± 0.78%)3.18s (± 0.64%)-0.02s (- 0.75%)3.13s3.22s
Total Time10.39s (± 0.48%)10.23s (± 0.52%)-0.16s (- 1.52%)10.09s10.38s
TFS - node (v8.9.0, x86)
Memory used178,226k (± 0.01%)178,113k (± 0.03%)-113k (- 0.06%)177,946k178,168k
Parse Time1.31s (± 1.06%)1.20s (± 0.67%)-0.11s (- 8.17%)1.18s1.22s
Bind Time0.64s (± 2.02%)0.64s (± 0.94%)-0.00s (- 0.31%)0.62s0.65s
Check Time4.31s (± 0.58%)4.31s (± 0.94%)-0.00s (- 0.02%)4.24s4.42s
Emit Time2.87s (± 0.90%)2.87s (± 2.36%)-0.01s (- 0.28%)2.72s3.08s
Total Time9.13s (± 0.55%)9.01s (± 1.01%)-0.12s (- 1.32%)8.81s9.21s
Angular - node (v9.0.0, x64)
Memory used343,677k (± 0.02%)336,426k (± 0.02%)-7,251k (- 2.11%)336,251k336,561k
Parse Time1.68s (± 0.41%)1.63s (± 0.80%)-0.05s (- 3.20%)1.62s1.68s
Bind Time0.77s (± 0.61%)0.75s (± 0.78%)-0.02s (- 2.99%)0.74s0.76s
Check Time4.79s (± 0.52%)4.59s (± 1.90%)-0.20s (- 4.18%)4.48s4.79s
Emit Time5.70s (± 1.88%)5.77s (± 2.28%)+0.08s (+ 1.35%)5.51s6.12s
Total Time12.94s (± 0.88%)12.74s (± 0.81%)-0.20s (- 1.56%)12.55s12.98s
Monaco - node (v9.0.0, x64)
Memory used363,407k (± 0.03%)362,934k (± 0.04%)-474k (- 0.13%)362,613k363,196k
Parse Time1.30s (± 0.56%)1.28s (± 0.81%)-0.02s (- 1.23%)1.26s1.31s
Bind Time0.86s (± 0.77%)0.85s (± 0.55%)-0.01s (- 1.51%)0.84s0.86s
Check Time4.90s (± 0.38%)4.86s (± 0.58%)-0.04s (- 0.88%)4.81s4.95s
Emit Time3.36s (± 0.58%)3.36s (± 0.33%)0.00s ( 0.00%)3.33s3.37s
Total Time10.42s (± 0.38%)10.35s (± 0.38%)-0.07s (- 0.62%)10.28s10.46s
TFS - node (v9.0.0, x64)
Memory used317,325k (± 0.01%)316,859k (± 0.01%)-465k (- 0.15%)316,776k316,950k
Parse Time1.03s (± 0.93%)1.02s (± 0.79%)-0.01s (- 0.78%)1.00s1.04s
Bind Time0.62s (± 0.72%)0.62s (± 0.80%)-0.00s (- 0.32%)0.61s0.63s
Check Time4.42s (± 0.65%)4.38s (± 1.22%)-0.03s (- 0.75%)4.33s4.59s
Emit Time3.22s (± 0.69%)3.18s (± 2.53%)-0.04s (- 1.27%)2.87s3.26s
Total Time9.28s (± 0.60%)9.20s (± 0.53%)-0.08s (- 0.87%)9.09s9.31s
Angular - node (v9.0.0, x86)
Memory used194,991k (± 0.02%)190,893k (± 0.02%)-4,097k (- 2.10%)190,766k191,009k
Parse Time1.60s (± 0.40%)1.54s (± 0.38%)-0.06s (- 4.06%)1.53s1.55s
Bind Time0.88s (± 0.54%)0.87s (± 0.68%)-0.00s (- 0.34%)0.86s0.89s
Check Time4.27s (± 0.54%)4.23s (± 0.73%)-0.04s (- 1.03%)4.17s4.30s
Emit Time5.51s (± 0.68%)5.47s (± 0.61%)-0.04s (- 0.76%)5.39s5.54s
Total Time12.26s (± 0.37%)12.11s (± 0.50%)-0.15s (- 1.26%)12.00s12.24s
Monaco - node (v9.0.0, x86)
Memory used203,085k (± 0.03%)202,783k (± 0.03%)-302k (- 0.15%)202,666k202,892k
Parse Time1.32s (± 0.73%)1.32s (± 0.71%)+0.00s (+ 0.08%)1.31s1.35s
Bind Time0.64s (± 0.46%)0.64s (± 0.77%)+0.00s (+ 0.47%)0.64s0.66s
Check Time4.69s (± 0.64%)4.67s (± 0.33%)-0.02s (- 0.53%)4.63s4.71s
Emit Time3.08s (± 0.78%)3.10s (± 0.36%)+0.02s (+ 0.71%)3.08s3.13s
Total Time9.73s (± 0.47%)9.74s (± 0.17%)+0.01s (+ 0.05%)9.70s9.77s
TFS - node (v9.0.0, x86)
Memory used178,385k (± 0.02%)178,137k (± 0.02%)-249k (- 0.14%)178,066k178,207k
Parse Time1.05s (± 0.90%)1.03s (± 0.48%)-0.02s (- 2.01%)1.02s1.04s
Bind Time0.57s (± 0.63%)0.58s (± 0.96%)+0.00s (+ 0.70%)0.57s0.59s
Check Time4.15s (± 0.62%)4.10s (± 0.54%)-0.05s (- 1.13%)4.05s4.14s
Emit Time2.78s (± 0.52%)2.78s (± 0.81%)-0.00s (- 0.14%)2.70s2.82s
Total Time8.55s (± 0.41%)8.48s (± 0.36%)-0.07s (- 0.80%)8.41s8.55s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-142-generic
Architecturex64
Available Memory16 GB
Available Memory1 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
  • node (v9.0.0, x64)
  • node (v9.0.0, x86)
Scenarios
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Angular - node (v9.0.0, x64)
  • Angular - node (v9.0.0, x86)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • Monaco - node (v9.0.0, x64)
  • Monaco - node (v9.0.0, x86)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • TFS - node (v9.0.0, x64)
  • TFS - node (v9.0.0, x86)
BenchmarkNameIterations
Current3258210
Baselinemaster10

@sandersn

Copy link
Copy Markdown
MemberAuthor

Perf numbers are about the same both ways. Wesley Wigham (@weswigham) can you take a look at the parameter-threaded management of isIntersectionConstituent to see what you think?

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.

I'm still concerned that isIntersectionConstituent needs to somehow be included in the relation cache ID - but I had that concern before this PR (and nobody's yet submitted a bug making that concern real), so I suppose nothing has changed.

// Report structural errors only if we haven't reported any errors yet
const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive;
result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined);
result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined, isIntersectionConstituent);

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.

Yep, seeing this change here, I have a vague memory of thinking that I didn't need to pass it thru here before because we didn't do deep excess property checking - now that we do, we should.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Excess property checking only applies to half of an intersection

3 participants

@sandersn@typescript-bot@weswigham