Skip to content

Improve excess property checking for intersections #32582

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 5 commits into from
Aug 6, 2019

Conversation

sandersn
Copy link
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

sandersn added 3 commits July 26, 2019 11:17
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
Member Author

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 @weswigham instead of requesting since the requested reviewers list is broken.)

@@ -29587,7 +29602,7 @@ namespace ts {
}
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
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?

Copy link
Member Author

@sandersn sandersn Aug 5, 2019

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
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.

@@ -12849,13 +12849,15 @@ namespace ts {
}
}
else if (target.flags & TypeFlags.Intersection) {
isIntersectionConstituent = true; // set here to affect the following trio of checks
Copy link
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
Member Author

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
Member Author

sandersn commented Aug 6, 2019

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 6, 2019

Heya @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
Collaborator

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

Here they are:

Comparison Report - master..32582

Metric master 32582 Delta Best Worst
Angular - node (v12.1.0, x64)
Memory used 325,374k (± 0.02%) 318,377k (± 0.02%) -6,997k (- 2.15%) 318,271k 318,579k
Parse Time 1.44s (± 0.77%) 1.40s (± 0.57%) -0.05s (- 3.25%) 1.38s 1.42s
Bind Time 0.76s (± 1.16%) 0.74s (± 0.81%) -0.02s (- 3.29%) 0.72s 0.75s
Check Time 4.20s (± 0.50%) 4.18s (± 0.50%) -0.02s (- 0.48%) 4.14s 4.23s
Emit Time 5.22s (± 0.62%) 5.27s (± 0.97%) +0.05s (+ 0.98%) 5.17s 5.41s
Total Time 11.63s (± 0.42%) 11.59s (± 0.40%) -0.04s (- 0.35%) 11.47s 11.71s
Monaco - node (v12.1.0, x64)
Memory used 345,801k (± 0.02%) 345,769k (± 0.02%) -32k (- 0.01%) 345,600k 345,926k
Parse Time 1.19s (± 0.57%) 1.19s (± 0.54%) -0.00s (- 0.25%) 1.18s 1.21s
Bind Time 0.68s (± 0.86%) 0.67s (± 0.66%) -0.01s (- 0.74%) 0.66s 0.68s
Check Time 4.27s (± 0.59%) 4.24s (± 0.55%) -0.03s (- 0.61%) 4.20s 4.30s
Emit Time 2.85s (± 0.77%) 2.86s (± 0.59%) +0.01s (+ 0.46%) 2.83s 2.91s
Total Time 8.98s (± 0.44%) 8.96s (± 0.39%) -0.02s (- 0.24%) 8.90s 9.04s
TFS - node (v12.1.0, x64)
Memory used 301,433k (± 0.01%) 301,271k (± 0.01%) -162k (- 0.05%) 301,174k 301,365k
Parse Time 0.93s (± 0.91%) 0.91s (± 0.63%) -0.02s (- 2.26%) 0.90s 0.92s
Bind Time 0.63s (± 0.80%) 0.62s (± 1.07%) -0.01s (- 0.80%) 0.61s 0.64s
Check Time 3.86s (± 0.55%) 3.79s (± 0.39%) -0.07s (- 1.86%) 3.75s 3.82s
Emit Time 2.98s (± 0.44%) 2.96s (± 0.87%) -0.02s (- 0.57%) 2.88s 3.00s
Total Time 8.39s (± 0.35%) 8.28s (± 0.42%) -0.11s (- 1.32%) 8.18s 8.34s
Angular - node (v8.9.0, x64)
Memory used 343,971k (± 0.02%) 336,854k (± 0.02%) -7,117k (- 2.07%) 336,704k 337,034k
Parse Time 1.92s (± 0.23%) 1.79s (± 0.41%) -0.13s (- 6.97%) 1.77s 1.80s
Bind Time 0.82s (± 0.82%) 0.80s (± 0.81%) -0.02s (- 1.84%) 0.79s 0.82s
Check Time 5.00s (± 0.68%) 5.00s (± 1.42%) -0.01s (- 0.14%) 4.81s 5.15s
Emit Time 6.07s (± 0.62%) 6.09s (± 1.51%) +0.02s (+ 0.26%) 5.92s 6.32s
Total Time 13.82s (± 0.29%) 13.67s (± 0.62%) -0.14s (- 1.04%) 13.44s 13.81s
Monaco - node (v8.9.0, x64)
Memory used 363,313k (± 0.01%) 363,160k (± 0.02%) -153k (- 0.04%) 363,026k 363,269k
Parse Time 1.53s (± 0.45%) 1.43s (± 0.40%) -0.09s (- 6.09%) 1.42s 1.44s
Bind Time 0.88s (± 0.51%) 0.90s (± 1.67%) +0.01s (+ 1.59%) 0.88s 0.93s
Check Time 5.26s (± 0.54%) 5.18s (± 1.52%) -0.08s (- 1.50%) 5.04s 5.34s
Emit Time 2.94s (± 0.52%) 3.16s (± 6.46%) +0.22s (+ 7.53%) 2.91s 3.50s
Total Time 10.61s (± 0.35%) 10.67s (± 1.38%) +0.06s (+ 0.58%) 10.46s 10.93s
TFS - node (v8.9.0, x64)
Memory used 317,300k (± 0.01%) 317,069k (± 0.02%) -231k (- 0.07%) 316,969k 317,172k
Parse Time 1.23s (± 0.57%) 1.14s (± 0.89%) -0.09s (- 7.31%) 1.12s 1.17s
Bind Time 0.66s (± 0.45%) 0.67s (± 0.86%) +0.01s (+ 1.21%) 0.66s 0.69s
Check Time 4.50s (± 0.67%) 4.47s (± 0.59%) -0.02s (- 0.53%) 4.41s 4.54s
Emit Time 3.06s (± 0.36%) 3.21s (± 2.61%) +0.14s (+ 4.67%) 2.94s 3.30s
Total Time 9.46s (± 0.36%) 9.49s (± 0.90%) +0.03s (+ 0.36%) 9.23s 9.62s
Angular - node (v8.9.0, x86)
Memory used 194,845k (± 0.02%) 190,864k (± 0.03%) -3,981k (- 2.04%) 190,747k 190,991k
Parse Time 1.87s (± 0.69%) 1.74s (± 0.49%) -0.13s (- 7.15%) 1.72s 1.76s
Bind Time 0.95s (± 0.63%) 0.95s (± 0.98%) -0.01s (- 0.73%) 0.93s 0.98s
Check Time 4.58s (± 0.51%) 4.54s (± 0.69%) -0.05s (- 1.05%) 4.47s 4.61s
Emit Time 5.81s (± 1.18%) 5.82s (± 0.89%) +0.01s (+ 0.15%) 5.67s 5.93s
Total Time 13.22s (± 0.60%) 13.04s (± 0.42%) -0.18s (- 1.37%) 12.90s 13.14s
Monaco - node (v8.9.0, x86)
Memory used 202,915k (± 0.02%) 202,750k (± 0.02%) -164k (- 0.08%) 202,662k 202,849k
Parse Time 1.59s (± 0.37%) 1.49s (± 0.87%) -0.09s (- 5.80%) 1.48s 1.53s
Bind Time 0.71s (± 0.71%) 0.72s (± 0.56%) +0.01s (+ 1.99%) 0.71s 0.73s
Check Time 4.86s (± 0.61%) 4.83s (± 0.46%) -0.03s (- 0.56%) 4.78s 4.88s
Emit Time 3.18s (± 0.33%) 3.18s (± 0.58%) -0.01s (- 0.16%) 3.13s 3.22s
Total Time 10.33s (± 0.33%) 10.23s (± 0.38%) -0.10s (- 1.02%) 10.12s 10.29s
TFS - node (v8.9.0, x86)
Memory used 178,235k (± 0.02%) 178,129k (± 0.02%) -107k (- 0.06%) 178,084k 178,213k
Parse Time 1.30s (± 0.47%) 1.19s (± 0.95%) -0.11s (- 8.47%) 1.17s 1.21s
Bind Time 0.63s (± 0.95%) 0.63s (± 0.75%) +0.01s (+ 1.12%) 0.63s 0.65s
Check Time 4.30s (± 0.53%) 4.26s (± 0.46%) -0.04s (- 1.00%) 4.22s 4.32s
Emit Time 2.86s (± 0.42%) 2.86s (± 1.33%) -0.00s (- 0.07%) 2.76s 2.97s
Total Time 9.08s (± 0.24%) 8.93s (± 0.57%) -0.15s (- 1.67%) 8.80s 9.08s
Angular - node (v9.0.0, x64)
Memory used 343,578k (± 0.02%) 336,472k (± 0.02%) -7,106k (- 2.07%) 336,392k 336,601k
Parse Time 1.68s (± 0.66%) 1.63s (± 0.36%) -0.06s (- 3.33%) 1.62s 1.64s
Bind Time 0.77s (± 0.52%) 0.75s (± 0.89%) -0.02s (- 3.11%) 0.73s 0.76s
Check Time 4.79s (± 0.75%) 4.53s (± 0.64%) -0.26s (- 5.39%) 4.49s 4.62s
Emit Time 5.72s (± 1.77%) 5.89s (± 1.95%) +0.17s (+ 2.94%) 5.72s 6.09s
Total Time 12.97s (± 1.02%) 12.79s (± 1.03%) -0.17s (- 1.33%) 12.56s 13.02s
Monaco - node (v9.0.0, x64)
Memory used 363,409k (± 0.03%) 362,968k (± 0.03%) -441k (- 0.12%) 362,720k 363,176k
Parse Time 1.30s (± 0.71%) 1.28s (± 0.93%) -0.02s (- 1.23%) 1.26s 1.31s
Bind Time 0.86s (± 1.18%) 0.86s (± 0.58%) +0.00s (+ 0.00%) 0.84s 0.86s
Check Time 4.92s (± 1.25%) 4.90s (± 0.54%) -0.02s (- 0.35%) 4.85s 4.95s
Emit Time 3.32s (± 3.51%) 3.38s (± 0.54%) +0.07s (+ 1.99%) 3.35s 3.43s
Total Time 10.39s (± 0.71%) 10.43s (± 0.41%) +0.04s (+ 0.34%) 10.36s 10.51s
TFS - node (v9.0.0, x64)
Memory used 317,317k (± 0.01%) 316,857k (± 0.02%) -460k (- 0.14%) 316,763k 316,993k
Parse Time 1.02s (± 0.69%) 1.02s (± 0.66%) -0.00s (- 0.20%) 1.00s 1.03s
Bind Time 0.62s (± 0.76%) 0.61s (± 0.85%) -0.01s (- 1.45%) 0.60s 0.62s
Check Time 4.37s (± 0.44%) 4.33s (± 0.69%) -0.04s (- 0.89%) 4.29s 4.43s
Emit Time 3.19s (± 1.03%) 3.20s (± 0.67%) +0.02s (+ 0.53%) 3.15s 3.25s
Total Time 9.20s (± 0.45%) 9.16s (± 0.55%) -0.03s (- 0.35%) 9.06s 9.33s
Angular - node (v9.0.0, x86)
Memory used 194,960k (± 0.02%) 190,887k (± 0.02%) -4,073k (- 2.09%) 190,811k 191,033k
Parse Time 1.60s (± 0.60%) 1.54s (± 0.68%) -0.06s (- 3.81%) 1.52s 1.56s
Bind Time 0.88s (± 0.54%) 0.88s (± 0.86%) -0.01s (- 0.79%) 0.87s 0.90s
Check Time 4.27s (± 0.77%) 4.21s (± 0.57%) -0.06s (- 1.45%) 4.16s 4.28s
Emit Time 5.51s (± 1.12%) 5.54s (± 0.84%) +0.03s (+ 0.56%) 5.43s 5.63s
Total Time 12.26s (± 0.53%) 12.17s (± 0.50%) -0.10s (- 0.77%) 12.01s 12.30s
Monaco - node (v9.0.0, x86)
Memory used 203,073k (± 0.02%) 202,783k (± 0.03%) -289k (- 0.14%) 202,661k 202,914k
Parse Time 1.32s (± 0.49%) 1.31s (± 0.49%) -0.01s (- 0.76%) 1.29s 1.32s
Bind Time 0.64s (± 0.58%) 0.64s (± 0.76%) -0.00s (- 0.16%) 0.64s 0.66s
Check Time 4.68s (± 0.39%) 4.67s (± 0.53%) -0.01s (- 0.21%) 4.62s 4.73s
Emit Time 3.09s (± 0.40%) 3.11s (± 0.77%) +0.02s (+ 0.52%) 3.07s 3.17s
Total Time 9.75s (± 0.26%) 9.74s (± 0.44%) -0.01s (- 0.07%) 9.65s 9.82s
TFS - node (v9.0.0, x86)
Memory used 178,423k (± 0.02%) 178,111k (± 0.02%) -312k (- 0.17%) 178,011k 178,210k
Parse Time 1.04s (± 0.64%) 1.03s (± 0.75%) -0.01s (- 1.06%) 1.01s 1.04s
Bind Time 0.58s (± 1.31%) 0.58s (± 0.90%) +0.00s (+ 0.52%) 0.57s 0.59s
Check Time 4.15s (± 0.72%) 4.12s (± 0.75%) -0.03s (- 0.82%) 4.03s 4.18s
Emit Time 2.79s (± 0.52%) 2.81s (± 1.65%) +0.02s (+ 0.72%) 2.71s 2.95s
Total Time 8.55s (± 0.40%) 8.53s (± 0.58%) -0.02s (- 0.20%) 8.45s 8.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)
Benchmark Name Iterations
Current 32582 10
Baseline master 10

@sandersn
Copy link
Member Author

sandersn commented Aug 6, 2019

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 perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 6, 2019

Heya @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
Collaborator

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

Here they are:

Comparison Report - master..32582

Metric master 32582 Delta Best Worst
Angular - node (v12.1.0, x64)
Memory used 325,458k (± 0.02%) 318,403k (± 0.01%) -7,055k (- 2.17%) 318,340k 318,496k
Parse Time 1.45s (± 0.67%) 1.39s (± 0.53%) -0.06s (- 4.20%) 1.38s 1.41s
Bind Time 0.76s (± 0.90%) 0.74s (± 0.40%) -0.02s (- 2.38%) 0.73s 0.74s
Check Time 4.23s (± 0.42%) 4.21s (± 0.47%) -0.01s (- 0.31%) 4.17s 4.25s
Emit Time 5.26s (± 0.76%) 5.25s (± 0.25%) -0.01s (- 0.25%) 5.22s 5.27s
Total Time 11.70s (± 0.47%) 11.59s (± 0.18%) -0.11s (- 0.92%) 11.52s 11.61s
Monaco - node (v12.1.0, x64)
Memory used 345,857k (± 0.01%) 345,780k (± 0.02%) -77k (- 0.02%) 345,671k 345,973k
Parse Time 1.19s (± 0.78%) 1.18s (± 0.64%) -0.01s (- 0.67%) 1.17s 1.20s
Bind Time 0.68s (± 0.59%) 0.68s (± 1.34%) 0.00s ( 0.00%) 0.67s 0.70s
Check Time 4.29s (± 0.43%) 4.25s (± 0.34%) -0.04s (- 0.98%) 4.22s 4.28s
Emit Time 2.86s (± 0.58%) 2.86s (± 0.55%) -0.00s (- 0.07%) 2.83s 2.90s
Total Time 9.02s (± 0.36%) 8.97s (± 0.29%) -0.05s (- 0.55%) 8.89s 9.02s
TFS - node (v12.1.0, x64)
Memory used 301,444k (± 0.03%) 301,289k (± 0.01%) -156k (- 0.05%) 301,158k 301,355k
Parse Time 0.93s (± 0.91%) 0.91s (± 0.90%) -0.02s (- 1.83%) 0.90s 0.94s
Bind Time 0.63s (± 0.75%) 0.62s (± 0.84%) -0.01s (- 2.21%) 0.61s 0.63s
Check Time 3.86s (± 0.40%) 3.81s (± 0.48%) -0.05s (- 1.19%) 3.78s 3.86s
Emit Time 2.98s (± 0.67%) 2.95s (± 0.63%) -0.03s (- 1.11%) 2.89s 2.98s
Total Time 8.40s (± 0.33%) 8.30s (± 0.37%) -0.11s (- 1.29%) 8.23s 8.35s
Angular - node (v8.9.0, x64)
Memory used 344,053k (± 0.01%) 336,879k (± 0.02%) -7,174k (- 2.09%) 336,760k 337,025k
Parse Time 1.94s (± 0.55%) 1.78s (± 0.38%) -0.15s (- 7.85%) 1.77s 1.80s
Bind Time 0.82s (± 0.81%) 0.80s (± 0.77%) -0.02s (- 2.67%) 0.79s 0.81s
Check Time 5.03s (± 0.76%) 4.96s (± 1.53%) -0.07s (- 1.47%) 4.78s 5.09s
Emit Time 6.05s (± 0.94%) 6.16s (± 2.02%) +0.11s (+ 1.82%) 5.83s 6.38s
Total Time 13.84s (± 0.66%) 13.70s (± 0.70%) -0.14s (- 1.00%) 13.49s 13.91s
Monaco - node (v8.9.0, x64)
Memory used 363,375k (± 0.01%) 363,118k (± 0.01%) -257k (- 0.07%) 363,035k 363,204k
Parse Time 1.53s (± 0.40%) 1.44s (± 0.33%) -0.09s (- 5.82%) 1.43s 1.45s
Bind Time 0.88s (± 0.66%) 0.89s (± 1.62%) +0.01s (+ 1.13%) 0.88s 0.93s
Check Time 5.32s (± 0.59%) 5.23s (± 1.38%) -0.10s (- 1.79%) 5.01s 5.32s
Emit Time 2.94s (± 0.49%) 3.04s (± 5.51%) +0.11s (+ 3.64%) 2.88s 3.50s
Total Time 10.67s (± 0.37%) 10.60s (± 1.11%) -0.07s (- 0.65%) 10.47s 10.94s
TFS - node (v8.9.0, x64)
Memory used 317,326k (± 0.02%) 317,089k (± 0.01%) -237k (- 0.07%) 317,011k 317,208k
Parse Time 1.24s (± 0.67%) 1.14s (± 0.51%) -0.09s (- 7.45%) 1.13s 1.16s
Bind Time 0.67s (± 0.78%) 0.67s (± 0.74%) -0.00s (- 0.45%) 0.66s 0.68s
Check Time 4.49s (± 0.44%) 4.44s (± 0.54%) -0.05s (- 1.11%) 4.40s 4.50s
Emit Time 3.07s (± 0.58%) 3.16s (± 2.14%) +0.09s (+ 3.03%) 3.04s 3.27s
Total Time 9.47s (± 0.34%) 9.41s (± 0.71%) -0.06s (- 0.58%) 9.27s 9.54s
Angular - node (v8.9.0, x86)
Memory used 194,911k (± 0.02%) 190,882k (± 0.04%) -4,030k (- 2.07%) 190,701k 190,977k
Parse Time 1.88s (± 0.37%) 1.73s (± 0.42%) -0.15s (- 7.82%) 1.72s 1.75s
Bind Time 0.96s (± 0.98%) 0.94s (± 0.77%) -0.02s (- 2.18%) 0.93s 0.96s
Check Time 4.58s (± 0.60%) 4.53s (± 0.59%) -0.05s (- 0.98%) 4.49s 4.61s
Emit Time 5.85s (± 1.58%) 5.82s (± 1.62%) -0.03s (- 0.50%) 5.69s 6.15s
Total Time 13.27s (± 0.77%) 13.03s (± 0.90%) -0.24s (- 1.82%) 12.87s 13.43s
Monaco - node (v8.9.0, x86)
Memory used 202,949k (± 0.02%) 202,786k (± 0.02%) -164k (- 0.08%) 202,698k 202,881k
Parse Time 1.60s (± 0.55%) 1.50s (± 0.59%) -0.10s (- 6.26%) 1.48s 1.52s
Bind Time 0.71s (± 1.06%) 0.72s (± 0.93%) +0.00s (+ 0.42%) 0.71s 0.74s
Check Time 4.88s (± 0.61%) 4.84s (± 0.75%) -0.04s (- 0.84%) 4.76s 4.95s
Emit Time 3.20s (± 0.78%) 3.18s (± 0.64%) -0.02s (- 0.75%) 3.13s 3.22s
Total Time 10.39s (± 0.48%) 10.23s (± 0.52%) -0.16s (- 1.52%) 10.09s 10.38s
TFS - node (v8.9.0, x86)
Memory used 178,226k (± 0.01%) 178,113k (± 0.03%) -113k (- 0.06%) 177,946k 178,168k
Parse Time 1.31s (± 1.06%) 1.20s (± 0.67%) -0.11s (- 8.17%) 1.18s 1.22s
Bind Time 0.64s (± 2.02%) 0.64s (± 0.94%) -0.00s (- 0.31%) 0.62s 0.65s
Check Time 4.31s (± 0.58%) 4.31s (± 0.94%) -0.00s (- 0.02%) 4.24s 4.42s
Emit Time 2.87s (± 0.90%) 2.87s (± 2.36%) -0.01s (- 0.28%) 2.72s 3.08s
Total Time 9.13s (± 0.55%) 9.01s (± 1.01%) -0.12s (- 1.32%) 8.81s 9.21s
Angular - node (v9.0.0, x64)
Memory used 343,677k (± 0.02%) 336,426k (± 0.02%) -7,251k (- 2.11%) 336,251k 336,561k
Parse Time 1.68s (± 0.41%) 1.63s (± 0.80%) -0.05s (- 3.20%) 1.62s 1.68s
Bind Time 0.77s (± 0.61%) 0.75s (± 0.78%) -0.02s (- 2.99%) 0.74s 0.76s
Check Time 4.79s (± 0.52%) 4.59s (± 1.90%) -0.20s (- 4.18%) 4.48s 4.79s
Emit Time 5.70s (± 1.88%) 5.77s (± 2.28%) +0.08s (+ 1.35%) 5.51s 6.12s
Total Time 12.94s (± 0.88%) 12.74s (± 0.81%) -0.20s (- 1.56%) 12.55s 12.98s
Monaco - node (v9.0.0, x64)
Memory used 363,407k (± 0.03%) 362,934k (± 0.04%) -474k (- 0.13%) 362,613k 363,196k
Parse Time 1.30s (± 0.56%) 1.28s (± 0.81%) -0.02s (- 1.23%) 1.26s 1.31s
Bind Time 0.86s (± 0.77%) 0.85s (± 0.55%) -0.01s (- 1.51%) 0.84s 0.86s
Check Time 4.90s (± 0.38%) 4.86s (± 0.58%) -0.04s (- 0.88%) 4.81s 4.95s
Emit Time 3.36s (± 0.58%) 3.36s (± 0.33%) 0.00s ( 0.00%) 3.33s 3.37s
Total Time 10.42s (± 0.38%) 10.35s (± 0.38%) -0.07s (- 0.62%) 10.28s 10.46s
TFS - node (v9.0.0, x64)
Memory used 317,325k (± 0.01%) 316,859k (± 0.01%) -465k (- 0.15%) 316,776k 316,950k
Parse Time 1.03s (± 0.93%) 1.02s (± 0.79%) -0.01s (- 0.78%) 1.00s 1.04s
Bind Time 0.62s (± 0.72%) 0.62s (± 0.80%) -0.00s (- 0.32%) 0.61s 0.63s
Check Time 4.42s (± 0.65%) 4.38s (± 1.22%) -0.03s (- 0.75%) 4.33s 4.59s
Emit Time 3.22s (± 0.69%) 3.18s (± 2.53%) -0.04s (- 1.27%) 2.87s 3.26s
Total Time 9.28s (± 0.60%) 9.20s (± 0.53%) -0.08s (- 0.87%) 9.09s 9.31s
Angular - node (v9.0.0, x86)
Memory used 194,991k (± 0.02%) 190,893k (± 0.02%) -4,097k (- 2.10%) 190,766k 191,009k
Parse Time 1.60s (± 0.40%) 1.54s (± 0.38%) -0.06s (- 4.06%) 1.53s 1.55s
Bind Time 0.88s (± 0.54%) 0.87s (± 0.68%) -0.00s (- 0.34%) 0.86s 0.89s
Check Time 4.27s (± 0.54%) 4.23s (± 0.73%) -0.04s (- 1.03%) 4.17s 4.30s
Emit Time 5.51s (± 0.68%) 5.47s (± 0.61%) -0.04s (- 0.76%) 5.39s 5.54s
Total Time 12.26s (± 0.37%) 12.11s (± 0.50%) -0.15s (- 1.26%) 12.00s 12.24s
Monaco - node (v9.0.0, x86)
Memory used 203,085k (± 0.03%) 202,783k (± 0.03%) -302k (- 0.15%) 202,666k 202,892k
Parse Time 1.32s (± 0.73%) 1.32s (± 0.71%) +0.00s (+ 0.08%) 1.31s 1.35s
Bind Time 0.64s (± 0.46%) 0.64s (± 0.77%) +0.00s (+ 0.47%) 0.64s 0.66s
Check Time 4.69s (± 0.64%) 4.67s (± 0.33%) -0.02s (- 0.53%) 4.63s 4.71s
Emit Time 3.08s (± 0.78%) 3.10s (± 0.36%) +0.02s (+ 0.71%) 3.08s 3.13s
Total Time 9.73s (± 0.47%) 9.74s (± 0.17%) +0.01s (+ 0.05%) 9.70s 9.77s
TFS - node (v9.0.0, x86)
Memory used 178,385k (± 0.02%) 178,137k (± 0.02%) -249k (- 0.14%) 178,066k 178,207k
Parse Time 1.05s (± 0.90%) 1.03s (± 0.48%) -0.02s (- 2.01%) 1.02s 1.04s
Bind Time 0.57s (± 0.63%) 0.58s (± 0.96%) +0.00s (+ 0.70%) 0.57s 0.59s
Check Time 4.15s (± 0.62%) 4.10s (± 0.54%) -0.05s (- 1.13%) 4.05s 4.14s
Emit Time 2.78s (± 0.52%) 2.78s (± 0.81%) -0.00s (- 0.14%) 2.70s 2.82s
Total Time 8.55s (± 0.41%) 8.48s (± 0.36%) -0.07s (- 0.80%) 8.41s 8.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)
Benchmark Name Iterations
Current 32582 10
Baseline master 10

@sandersn
Copy link
Member Author

sandersn commented Aug 6, 2019

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

Copy link
Member

@weswigham weswigham left a comment

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.

@@ -13584,7 +13584,7 @@ namespace ts {
if (source.flags & (TypeFlags.Object | TypeFlags.Intersection) && target.flags & TypeFlags.Object) {
// 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
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 free to join this conversation on GitHub. Already have an account? Sign in to comment
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