Skip to content
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

Instantiate generic conditional infer source types in the context of the target conditional #31545

Merged
merged 2 commits into from
Aug 19, 2019

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented May 22, 2019

Fixes another part of #30732

Fixes #26627

@weswigham weswigham requested a review from ahejlsberg May 22, 2019 23:52
@weswigham
Copy link
Member Author

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 22, 2019

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

typescript-bot commented May 22, 2019

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 22, 2019

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

@ahejlsberg
Copy link
Member

Does this fix #26627?

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..31545

Metric master 31545 Delta Best Worst
Angular - node (v12.1.0, x64)
Memory used 315,038k (± 0.02%) 314,969k (± 0.02%) -69k (- 0.02%) 314,830k 315,094k
Parse Time 1.39s (± 0.29%) 1.38s (± 0.67%) -0.01s (- 0.50%) 1.36s 1.40s
Bind Time 0.73s (± 0.76%) 0.73s (± 1.82%) +0.01s (+ 0.69%) 0.72s 0.78s
Check Time 4.06s (± 0.70%) 4.05s (± 0.51%) -0.01s (- 0.20%) 4.01s 4.11s
Emit Time 5.19s (± 0.56%) 5.16s (± 0.61%) -0.03s (- 0.52%) 5.09s 5.22s
Total Time 11.36s (± 0.47%) 11.32s (± 0.42%) -0.04s (- 0.36%) 11.21s 11.43s
Monaco - node (v12.1.0, x64)
Memory used 343,753k (± 0.02%) 343,707k (± 0.01%) -46k (- 0.01%) 343,582k 343,815k
Parse Time 1.18s (± 0.73%) 1.18s (± 0.76%) -0.01s (- 0.59%) 1.16s 1.20s
Bind Time 0.67s (± 1.38%) 0.68s (± 0.74%) +0.00s (+ 0.45%) 0.67s 0.69s
Check Time 4.17s (± 0.51%) 4.15s (± 0.67%) -0.03s (- 0.62%) 4.09s 4.20s
Emit Time 2.77s (± 0.63%) 2.78s (± 1.04%) +0.01s (+ 0.29%) 2.74s 2.87s
Total Time 8.80s (± 0.38%) 8.77s (± 0.55%) -0.03s (- 0.30%) 8.67s 8.91s
TFS - node (v12.1.0, x64)
Memory used 300,788k (± 0.02%) 300,750k (± 0.02%) -39k (- 0.01%) 300,623k 300,843k
Parse Time 0.91s (± 0.57%) 0.91s (± 0.64%) -0.00s (- 0.22%) 0.89s 0.92s
Bind Time 0.63s (± 1.99%) 0.62s (± 1.39%) -0.00s (- 0.80%) 0.61s 0.65s
Check Time 3.73s (± 0.59%) 3.74s (± 0.43%) +0.01s (+ 0.19%) 3.71s 3.78s
Emit Time 2.85s (± 0.93%) 2.86s (± 0.83%) +0.01s (+ 0.32%) 2.82s 2.92s
Total Time 8.12s (± 0.36%) 8.12s (± 0.45%) +0.00s (+ 0.05%) 8.04s 8.19s
Angular - node (v8.9.0, x64)
Memory used 332,940k (± 0.02%) 332,878k (± 0.02%) -62k (- 0.02%) 332,775k 332,980k
Parse Time 1.78s (± 0.59%) 1.77s (± 0.43%) -0.01s (- 0.28%) 1.76s 1.80s
Bind Time 0.79s (± 1.10%) 0.78s (± 1.13%) -0.01s (- 1.02%) 0.76s 0.80s
Check Time 4.73s (± 1.05%) 4.69s (± 0.84%) -0.05s (- 0.97%) 4.64s 4.83s
Emit Time 5.88s (± 3.24%) 5.99s (± 1.99%) +0.11s (+ 1.85%) 5.74s 6.17s
Total Time 13.18s (± 1.40%) 13.23s (± 0.87%) +0.05s (+ 0.34%) 12.97s 13.43s
Monaco - node (v8.9.0, x64)
Memory used 360,898k (± 0.02%) 360,919k (± 0.02%) +22k (+ 0.01%) 360,800k 361,072k
Parse Time 1.43s (± 0.35%) 1.43s (± 0.33%) -0.01s (- 0.35%) 1.42s 1.44s
Bind Time 0.89s (± 1.87%) 0.90s (± 2.49%) +0.01s (+ 1.24%) 0.86s 0.93s
Check Time 5.05s (± 1.58%) 4.96s (± 1.75%) -0.10s (- 1.96%) 4.79s 5.12s
Emit Time 3.01s (± 6.09%) 3.17s (± 6.58%) +0.16s (+ 5.32%) 2.79s 3.46s
Total Time 10.39s (± 1.18%) 10.46s (± 1.48%) +0.07s (+ 0.66%) 10.16s 10.74s
TFS - node (v8.9.0, x64)
Memory used 316,335k (± 0.01%) 316,312k (± 0.01%) -23k (- 0.01%) 316,212k 316,453k
Parse Time 1.14s (± 0.49%) 1.14s (± 0.32%) -0.00s (- 0.18%) 1.13s 1.14s
Bind Time 0.67s (± 0.56%) 0.66s (± 0.45%) -0.00s (- 0.45%) 0.66s 0.67s
Check Time 4.34s (± 0.41%) 4.34s (± 0.51%) +0.00s (+ 0.02%) 4.28s 4.40s
Emit Time 3.12s (± 1.25%) 3.14s (± 0.50%) +0.03s (+ 0.83%) 3.09s 3.17s
Total Time 9.26s (± 0.41%) 9.28s (± 0.31%) +0.02s (+ 0.26%) 9.23s 9.37s
Angular - node (v8.9.0, x86)
Memory used 188,574k (± 0.02%) 188,561k (± 0.03%) -12k (- 0.01%) 188,467k 188,675k
Parse Time 1.73s (± 0.73%) 1.71s (± 0.62%) -0.01s (- 0.64%) 1.70s 1.74s
Bind Time 0.93s (± 1.07%) 0.93s (± 0.78%) -0.00s (- 0.11%) 0.91s 0.94s
Check Time 4.40s (± 0.52%) 4.39s (± 0.30%) -0.01s (- 0.25%) 4.37s 4.42s
Emit Time 5.74s (± 1.72%) 5.70s (± 1.06%) -0.04s (- 0.73%) 5.62s 5.92s
Total Time 12.80s (± 0.96%) 12.74s (± 0.52%) -0.06s (- 0.49%) 12.65s 12.96s
Monaco - node (v8.9.0, x86)
Memory used 201,357k (± 0.02%) 201,317k (± 0.02%) -40k (- 0.02%) 201,223k 201,392k
Parse Time 1.49s (± 0.67%) 1.49s (± 0.46%) -0.00s (- 0.07%) 1.47s 1.50s
Bind Time 0.72s (± 0.69%) 0.71s (± 0.84%) -0.00s (- 0.14%) 0.70s 0.73s
Check Time 4.74s (± 0.45%) 4.75s (± 0.79%) +0.01s (+ 0.25%) 4.68s 4.84s
Emit Time 3.08s (± 0.65%) 3.07s (± 0.64%) -0.01s (- 0.36%) 3.03s 3.12s
Total Time 10.02s (± 0.23%) 10.02s (± 0.44%) -0.00s (- 0.01%) 9.93s 10.14s
TFS - node (v8.9.0, x86)
Memory used 177,437k (± 0.01%) 177,419k (± 0.02%) -19k (- 0.01%) 177,339k 177,487k
Parse Time 1.20s (± 0.48%) 1.19s (± 0.78%) -0.01s (- 1.00%) 1.18s 1.22s
Bind Time 0.63s (± 1.15%) 0.63s (± 1.05%) -0.00s (- 0.32%) 0.62s 0.64s
Check Time 4.14s (± 0.82%) 4.14s (± 0.87%) -0.00s (- 0.02%) 4.08s 4.26s
Emit Time 2.78s (± 0.92%) 2.75s (± 0.81%) -0.03s (- 1.04%) 2.67s 2.79s
Total Time 8.76s (± 0.56%) 8.71s (± 0.57%) -0.05s (- 0.55%) 8.60s 8.83s
Angular - node (v9.0.0, x64)
Memory used 332,595k (± 0.01%) 332,608k (± 0.01%) +13k (+ 0.00%) 332,522k 332,675k
Parse Time 1.63s (± 0.57%) 1.63s (± 0.72%) +0.00s (+ 0.06%) 1.60s 1.66s
Bind Time 0.75s (± 1.09%) 0.74s (± 0.95%) -0.01s (- 0.80%) 0.73s 0.76s
Check Time 4.40s (± 0.35%) 4.41s (± 0.52%) +0.01s (+ 0.25%) 4.35s 4.46s
Emit Time 5.65s (± 0.87%) 5.63s (± 0.85%) -0.02s (- 0.34%) 5.55s 5.79s
Total Time 12.42s (± 0.50%) 12.41s (± 0.48%) -0.01s (- 0.12%) 12.28s 12.58s
Monaco - node (v9.0.0, x64)
Memory used 360,675k (± 0.04%) 360,605k (± 0.03%) -70k (- 0.02%) 360,422k 360,846k
Parse Time 1.29s (± 0.62%) 1.28s (± 0.41%) -0.01s (- 0.70%) 1.27s 1.29s
Bind Time 0.85s (± 0.47%) 0.85s (± 0.65%) +0.00s (+ 0.12%) 0.84s 0.86s
Check Time 4.78s (± 0.60%) 4.80s (± 0.51%) +0.02s (+ 0.44%) 4.74s 4.86s
Emit Time 3.28s (± 0.53%) 3.28s (± 0.56%) +0.00s (+ 0.09%) 3.25s 3.32s
Total Time 10.20s (± 0.42%) 10.21s (± 0.41%) +0.01s (+ 0.14%) 10.11s 10.28s
TFS - node (v9.0.0, x64)
Memory used 316,138k (± 0.02%) 316,167k (± 0.02%) +29k (+ 0.01%) 316,028k 316,303k
Parse Time 1.01s (± 0.86%) 1.00s (± 0.66%) -0.01s (- 1.19%) 0.99s 1.02s
Bind Time 0.61s (± 0.49%) 0.61s (± 0.65%) -0.00s (- 0.16%) 0.60s 0.62s
Check Time 4.28s (± 1.34%) 4.43s (± 1.30%) +0.15s (+ 3.51%) 4.22s 4.51s
Emit Time 3.07s (± 2.51%) 2.89s (± 2.03%) -0.18s (- 5.74%) 2.82s 3.10s
Total Time 8.97s (± 0.41%) 8.93s (± 0.11%) -0.04s (- 0.46%) 8.90s 8.95s
Angular - node (v9.0.0, x86)
Memory used 188,709k (± 0.03%) 188,686k (± 0.03%) -23k (- 0.01%) 188,591k 188,825k
Parse Time 1.55s (± 0.79%) 1.53s (± 0.57%) -0.02s (- 1.29%) 1.51s 1.55s
Bind Time 0.86s (± 0.77%) 0.85s (± 0.72%) -0.01s (- 1.39%) 0.84s 0.87s
Check Time 4.10s (± 0.45%) 4.08s (± 0.50%) -0.02s (- 0.51%) 4.03s 4.11s
Emit Time 5.36s (± 0.80%) 5.33s (± 0.32%) -0.03s (- 0.65%) 5.28s 5.36s
Total Time 11.88s (± 0.53%) 11.79s (± 0.27%) -0.09s (- 0.73%) 11.74s 11.89s
Monaco - node (v9.0.0, x86)
Memory used 201,361k (± 0.02%) 201,361k (± 0.01%) -0k (- 0.00%) 201,324k 201,420k
Parse Time 1.32s (± 0.80%) 1.30s (± 0.81%) -0.01s (- 1.06%) 1.28s 1.33s
Bind Time 0.64s (± 0.76%) 0.64s (± 0.76%) -0.00s (- 0.00%) 0.64s 0.66s
Check Time 4.60s (± 0.24%) 4.59s (± 0.70%) -0.01s (- 0.28%) 4.51s 4.68s
Emit Time 3.02s (± 0.57%) 3.00s (± 0.77%) -0.02s (- 0.66%) 2.93s 3.05s
Total Time 9.59s (± 0.26%) 9.54s (± 0.41%) -0.05s (- 0.53%) 9.43s 9.61s
TFS - node (v9.0.0, x86)
Memory used 177,484k (± 0.02%) 177,504k (± 0.02%) +20k (+ 0.01%) 177,438k 177,575k
Parse Time 1.03s (± 0.56%) 1.02s (± 0.89%) -0.01s (- 1.07%) 1.01s 1.05s
Bind Time 0.57s (± 0.59%) 0.57s (± 0.86%) +0.00s (+ 0.17%) 0.56s 0.58s
Check Time 4.01s (± 0.73%) 3.98s (± 0.62%) -0.03s (- 0.77%) 3.93s 4.03s
Emit Time 2.71s (± 1.15%) 2.71s (± 0.77%) +0.00s (+ 0.04%) 2.66s 2.77s
Total Time 8.33s (± 0.58%) 8.29s (± 0.46%) -0.04s (- 0.49%) 8.17s 8.34s
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 31545 10
Baseline master 10

@weswigham
Copy link
Member Author

Huh, the perf failure is due to a regression in emit time in x64 only in older node only. @rbuckton - any insights?

@weswigham
Copy link
Member Author

Yep, this fixes #26627

@weswigham
Copy link
Member Author

RWC is clean (failure was just an unaccepted diff of some new baselines in master). The DT failures are all the same as in master. Perf seems... odd? As I said, older x64 node only with a regression in emit time only - not check time (and the emit time variance is high, too, at +/- 2-7%, which is sometimes more than the failing diff).

All in all, change seems good. @ahejlsberg wanna review?

@weswigham weswigham merged commit fd1e22b into microsoft:master Aug 19, 2019
@weswigham weswigham deleted the conditional-extends-contextof branch August 19, 2019 20:01
timsuchanek pushed a commit to timsuchanek/TypeScript that referenced this pull request Sep 11, 2019
…the target conditional (microsoft#31545)

* Instantiate generic conditional infer source types in the context of the target conditional

* Add test case from microsoft#26627
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.

"Two different types with this name exist, but they are unrelated" emitted when same
3 participants