Skip to content

Conversation

@ahejlsberg
Copy link
Member

Fixes #33448. Also fixes the issue in #33498 (comment).

This PR supercedes #33498. (Thanks @jack-williams!)

@ahejlsberg
Copy link
Member Author

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2019

Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 6bc8b12. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2019

Heya @ahejlsberg, I've started to run the extended test suite on this PR at 6bc8b12. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2019

Heya @ahejlsberg, I've started to run the parallelized community code test suite on this PR at 6bc8b12. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2019

Heya @ahejlsberg, I've started to run the perf test suite on this PR at 6bc8b12. 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

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

Here they are:

Comparison Report - master..35513

Metric master 35513 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 354,807k (± 0.02%) 356,542k (± 0.02%) +1,736k (+ 0.49%) 356,315k 356,620k
Parse Time 1.61s (± 0.60%) 1.63s (± 0.35%) +0.02s (+ 1.31%) 1.62s 1.64s
Bind Time 0.86s (± 0.95%) 0.86s (± 0.77%) +0.00s (+ 0.35%) 0.85s 0.87s
Check Time 4.53s (± 0.27%) 4.53s (± 0.61%) +0.01s (+ 0.13%) 4.49s 4.60s
Emit Time 5.25s (± 0.47%) 5.22s (± 0.71%) -0.02s (- 0.38%) 5.16s 5.31s
Total Time 12.24s (± 0.28%) 12.25s (± 0.43%) +0.01s (+ 0.09%) 12.17s 12.38s
Monaco - node (v10.16.3, x64)
Memory used 366,213k (± 0.01%) 366,145k (± 0.01%) -68k (- 0.02%) 366,038k 366,273k
Parse Time 1.25s (± 0.61%) 1.26s (± 0.85%) +0.01s (+ 0.48%) 1.25s 1.29s
Bind Time 0.76s (± 0.49%) 0.76s (± 0.48%) +0.00s (+ 0.13%) 0.75s 0.76s
Check Time 4.65s (± 0.59%) 4.66s (± 0.64%) +0.01s (+ 0.28%) 4.58s 4.72s
Emit Time 2.93s (± 0.71%) 2.94s (± 0.50%) +0.01s (+ 0.20%) 2.91s 2.98s
Total Time 9.58s (± 0.40%) 9.61s (± 0.48%) +0.03s (+ 0.28%) 9.51s 9.73s
TFS - node (v10.16.3, x64)
Memory used 321,970k (± 0.03%) 321,977k (± 0.01%) +7k (+ 0.00%) 321,915k 322,039k
Parse Time 0.95s (± 0.71%) 0.95s (± 0.86%) -0.00s (- 0.10%) 0.94s 0.97s
Bind Time 0.73s (± 1.12%) 0.72s (± 1.38%) -0.01s (- 0.96%) 0.70s 0.74s
Check Time 4.11s (± 0.35%) 4.14s (± 0.35%) +0.03s (+ 0.66%) 4.10s 4.17s
Emit Time 3.04s (± 0.78%) 3.06s (± 0.65%) +0.01s (+ 0.39%) 3.00s 3.10s
Total Time 8.83s (± 0.34%) 8.87s (± 0.33%) +0.03s (+ 0.38%) 8.82s 8.95s
Angular - node (v12.1.0, x64)
Memory used 330,399k (± 0.04%) 332,012k (± 0.01%) +1,612k (+ 0.49%) 331,945k 332,113k
Parse Time 1.57s (± 0.63%) 1.59s (± 0.56%) +0.02s (+ 1.08%) 1.57s 1.61s
Bind Time 0.84s (± 0.68%) 0.85s (± 0.52%) +0.01s (+ 1.43%) 0.84s 0.86s
Check Time 4.42s (± 0.44%) 4.47s (± 0.42%) +0.05s (+ 1.15%) 4.43s 4.51s
Emit Time 5.47s (± 1.35%) 5.52s (± 0.68%) +0.05s (+ 0.91%) 5.45s 5.62s
Total Time 12.30s (± 0.69%) 12.43s (± 0.32%) +0.13s (+ 1.06%) 12.34s 12.53s
Monaco - node (v12.1.0, x64)
Memory used 345,927k (± 0.01%) 345,898k (± 0.01%) -29k (- 0.01%) 345,827k 346,030k
Parse Time 1.23s (± 0.42%) 1.22s (± 0.61%) -0.01s (- 0.73%) 1.20s 1.23s
Bind Time 0.72s (± 1.15%) 0.72s (± 0.65%) -0.00s (- 0.69%) 0.71s 0.73s
Check Time 4.49s (± 0.27%) 4.49s (± 0.56%) -0.01s (- 0.18%) 4.43s 4.54s
Emit Time 2.98s (± 1.31%) 2.98s (± 1.07%) +0.00s (+ 0.07%) 2.93s 3.09s
Total Time 9.43s (± 0.42%) 9.41s (± 0.50%) -0.02s (- 0.18%) 9.34s 9.53s
TFS - node (v12.1.0, x64)
Memory used 304,312k (± 0.02%) 304,352k (± 0.02%) +40k (+ 0.01%) 304,231k 304,476k
Parse Time 0.95s (± 0.71%) 0.95s (± 1.00%) +0.00s (+ 0.00%) 0.92s 0.96s
Bind Time 0.68s (± 0.69%) 0.68s (± 0.33%) -0.00s (- 0.15%) 0.67s 0.68s
Check Time 4.05s (± 0.63%) 4.05s (± 0.44%) +0.01s (+ 0.17%) 4.01s 4.09s
Emit Time 3.05s (± 1.01%) 3.07s (± 0.46%) +0.02s (+ 0.69%) 3.04s 3.10s
Total Time 8.72s (± 0.50%) 8.75s (± 0.23%) +0.03s (+ 0.33%) 8.70s 8.80s
Angular - node (v8.9.0, x64)
Memory used 349,620k (± 0.01%) 351,274k (± 0.01%) +1,654k (+ 0.47%) 351,166k 351,312k
Parse Time 2.10s (± 0.40%) 2.11s (± 0.36%) +0.01s (+ 0.62%) 2.10s 2.13s
Bind Time 0.91s (± 0.71%) 0.92s (± 0.79%) +0.01s (+ 1.54%) 0.91s 0.94s
Check Time 5.29s (± 0.61%) 5.28s (± 0.54%) -0.00s (- 0.08%) 5.23s 5.35s
Emit Time 6.23s (± 1.08%) 6.26s (± 0.71%) +0.03s (+ 0.55%) 6.15s 6.37s
Total Time 14.52s (± 0.69%) 14.58s (± 0.36%) +0.06s (+ 0.43%) 14.48s 14.72s
Monaco - node (v8.9.0, x64)
Memory used 364,019k (± 0.01%) 364,016k (± 0.01%) -3k (- 0.00%) 363,893k 364,129k
Parse Time 1.56s (± 0.48%) 1.56s (± 0.31%) 0.00s ( 0.00%) 1.55s 1.57s
Bind Time 0.93s (± 0.78%) 0.93s (± 0.70%) 0.00s ( 0.00%) 0.91s 0.94s
Check Time 5.57s (± 0.59%) 5.56s (± 0.44%) -0.01s (- 0.13%) 5.50s 5.60s
Emit Time 3.03s (± 0.62%) 3.04s (± 0.84%) +0.01s (+ 0.20%) 3.00s 3.11s
Total Time 11.09s (± 0.41%) 11.09s (± 0.37%) -0.00s (- 0.04%) 11.04s 11.20s
TFS - node (v8.9.0, x64)
Memory used 320,953k (± 0.01%) 320,948k (± 0.02%) -5k (- 0.00%) 320,823k 321,050k
Parse Time 1.26s (± 0.51%) 1.26s (± 0.29%) +0.00s (+ 0.16%) 1.26s 1.27s
Bind Time 0.74s (± 0.60%) 0.74s (± 0.75%) -0.00s (- 0.00%) 0.73s 0.75s
Check Time 4.75s (± 0.40%) 4.73s (± 0.54%) -0.02s (- 0.34%) 4.69s 4.81s
Emit Time 3.19s (± 0.95%) 3.19s (± 0.45%) +0.00s (+ 0.03%) 3.17s 3.23s
Total Time 9.94s (± 0.48%) 9.93s (± 0.39%) -0.02s (- 0.15%) 9.86s 10.02s
Angular - node (v8.9.0, x86)
Memory used 198,592k (± 0.02%) 199,462k (± 0.02%) +870k (+ 0.44%) 199,388k 199,511k
Parse Time 2.03s (± 0.90%) 2.04s (± 0.39%) +0.01s (+ 0.64%) 2.02s 2.06s
Bind Time 1.04s (± 1.19%) 1.01s (± 0.59%) -0.03s (- 2.68%) 1.00s 1.03s
Check Time 4.81s (± 0.38%) 4.80s (± 0.52%) -0.00s (- 0.04%) 4.77s 4.88s
Emit Time 6.01s (± 0.79%) 6.00s (± 0.46%) -0.02s (- 0.30%) 5.94s 6.05s
Total Time 13.89s (± 0.46%) 13.86s (± 0.19%) -0.03s (- 0.24%) 13.81s 13.93s
Monaco - node (v8.9.0, x86)
Memory used 203,931k (± 0.02%) 203,943k (± 0.03%) +13k (+ 0.01%) 203,827k 204,076k
Parse Time 1.61s (± 0.90%) 1.62s (± 1.12%) +0.01s (+ 0.37%) 1.59s 1.66s
Bind Time 0.74s (± 0.87%) 0.74s (± 0.80%) +0.00s (+ 0.27%) 0.73s 0.76s
Check Time 5.40s (± 0.84%) 5.39s (± 1.19%) -0.02s (- 0.31%) 5.15s 5.48s
Emit Time 2.88s (± 2.58%) 2.89s (± 2.67%) +0.00s (+ 0.14%) 2.81s 3.18s
Total Time 10.65s (± 0.46%) 10.64s (± 0.49%) -0.01s (- 0.06%) 10.53s 10.74s
TFS - node (v8.9.0, x86)
Memory used 180,831k (± 0.03%) 180,869k (± 0.02%) +38k (+ 0.02%) 180,771k 180,947k
Parse Time 1.31s (± 0.85%) 1.30s (± 0.81%) -0.00s (- 0.23%) 1.28s 1.33s
Bind Time 0.69s (± 0.99%) 0.70s (± 0.68%) +0.00s (+ 0.29%) 0.69s 0.71s
Check Time 4.50s (± 0.74%) 4.47s (± 0.65%) -0.03s (- 0.60%) 4.40s 4.55s
Emit Time 2.96s (± 0.71%) 2.97s (± 1.53%) +0.01s (+ 0.27%) 2.85s 3.09s
Total Time 9.46s (± 0.63%) 9.44s (± 0.78%) -0.02s (- 0.23%) 9.33s 9.63s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory6 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
Benchmark Name Iterations
Current 35513 10
Baseline master 10

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@ahejlsberg
Copy link
Member Author

RWC and Community test errors look to be preexisting conditions.

@weswigham
Copy link
Member

RWC is clean on master. Maybe try syncing the branch and running again? Otherwise the change is real.

@ahejlsberg
Copy link
Member Author

Looked at it more closely. The RWC difference is just simple error message change because we now pick a different (and arguably better) union constituent to elaborate.

(<TransientSymbol>prop).isDiscriminantProperty =
((<TransientSymbol>prop).checkFlags & CheckFlags.Discriminant) === CheckFlags.Discriminant &&
isDiscriminantType(getTypeOfSymbol(prop));
!maybeTypeOfKind(getTypeOfSymbol(prop), TypeFlags.Instantiable);
Copy link
Member

Choose a reason for hiding this comment

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

What's the justification for not maybe instantiables here? Previously it was "not generic indexes", so this is quite a bit broader an exclusion, if I'm not mistaken.

Copy link
Member Author

Choose a reason for hiding this comment

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

If you look at isGenericIndexType you'll see that it's more than just generic index types. The code change just clarifies what's actually going on, there's no change in behavior.

Copy link
Member

Choose a reason for hiding this comment

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

Huh, alright, so it's equivalent. Neat.

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.

Do we also need to apply/extended similar logic to conditionals in some way? Like if I have a
(T extends U ? { type: "a" } : { type: "b" }) & { type: "b" }, shouldn't it be similarly simplified (at least outside of when infer variables are present)?

Sign up for free to 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.

Regression in 3.6: Combination of union and intersection types with literal types not resolving specific types properly

4 participants