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

Bail when comparing a specialized form of an already ongoing comparison #42727

Merged
merged 2 commits into from
Feb 24, 2021

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Feb 9, 2021

This accomplishes something very similar to #42726. but through exclusively manipulation of the type ID text. As such, it only works for type references, whose structure is partially encoded into the ID, and only in scenarios where we are starting with a comparison where all the type parameters of the types being compared are in their most general form. But it requires significantly less work to check, and manufactures no new types, when compared to #42726.

Fixes #38970

This and #42726 aren't technically mutually exclusive, but given that they target the same underlying inefficiency, I imagine we'll only take one until we have good reason to take the other.

@typescript-bot typescript-bot assigned weswigham and unassigned weswigham Feb 9, 2021
@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Feb 9, 2021
@weswigham
Copy link
Member Author

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 9, 2021

Heya @weswigham, I've started to run the parallelized community code test suite on this PR at e7547a1. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 9, 2021

Heya @weswigham, I've started to run the perf test suite on this PR at e7547a1. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 9, 2021

Heya @weswigham, I've started to run the tarball bundle task on this PR at e7547a1. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 9, 2021

Heya @weswigham, I've started to run the extended test suite on this PR at e7547a1. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 9, 2021

Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at e7547a1. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 10, 2021

Hey @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/95500/artifacts?artifactName=tgz&fileId=DE141D297F88B7C9FC6C7C74A1C84238E4BBF8F549572CB1CCBF014B66E9195B02&fileName=/typescript-4.2.0-insiders.20210210.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/[email protected]".;

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

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..42727

Metric master 42727 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 345,618k (± 0.02%) 345,645k (± 0.03%) +26k (+ 0.01%) 345,408k 345,820k
Parse Time 1.92s (± 0.40%) 1.92s (± 0.44%) +0.00s (+ 0.16%) 1.90s 1.93s
Bind Time 0.82s (± 0.60%) 0.83s (± 0.88%) +0.00s (+ 0.49%) 0.81s 0.85s
Check Time 4.97s (± 0.41%) 4.99s (± 0.43%) +0.02s (+ 0.36%) 4.95s 5.04s
Emit Time 5.28s (± 0.97%) 5.28s (± 0.80%) -0.00s (- 0.04%) 5.22s 5.43s
Total Time 12.99s (± 0.38%) 13.02s (± 0.46%) +0.03s (+ 0.22%) 12.92s 13.20s
Compiler-Unions - node (v10.16.3, x64)
Memory used 214,523k (± 0.06%) 214,385k (± 0.05%) -138k (- 0.06%) 214,120k 214,579k
Parse Time 0.78s (± 0.67%) 0.78s (± 0.57%) +0.00s (+ 0.39%) 0.77s 0.79s
Bind Time 0.50s (± 1.34%) 0.49s (± 1.18%) -0.00s (- 0.80%) 0.48s 0.50s
Check Time 10.65s (± 0.40%) 10.80s (± 0.73%) +0.15s (+ 1.38%) 10.66s 10.99s
Emit Time 2.35s (± 1.67%) 2.36s (± 0.71%) +0.01s (+ 0.51%) 2.31s 2.39s
Total Time 14.27s (± 0.38%) 14.43s (± 0.62%) +0.16s (+ 1.11%) 14.25s 14.65s
Monaco - node (v10.16.3, x64)
Memory used 355,251k (± 0.02%) 355,308k (± 0.03%) +57k (+ 0.02%) 355,129k 355,620k
Parse Time 1.55s (± 0.58%) 1.56s (± 0.45%) +0.01s (+ 0.64%) 1.54s 1.58s
Bind Time 0.72s (± 0.55%) 0.73s (± 0.80%) +0.01s (+ 0.83%) 0.71s 0.74s
Check Time 5.09s (± 0.57%) 5.16s (± 0.52%) +0.07s (+ 1.40%) 5.12s 5.23s
Emit Time 2.79s (± 0.64%) 2.80s (± 0.40%) +0.02s (+ 0.54%) 2.78s 2.83s
Total Time 10.15s (± 0.32%) 10.25s (± 0.30%) +0.10s (+ 1.01%) 10.18s 10.32s
TFS - node (v10.16.3, x64)
Memory used 308,114k (± 0.02%) 308,166k (± 0.02%) +52k (+ 0.02%) 308,020k 308,274k
Parse Time 1.20s (± 0.63%) 1.21s (± 0.49%) +0.00s (+ 0.17%) 1.19s 1.22s
Bind Time 0.68s (± 0.49%) 0.68s (± 0.77%) -0.00s (- 0.15%) 0.67s 0.69s
Check Time 4.60s (± 0.57%) 4.63s (± 0.57%) +0.03s (+ 0.57%) 4.54s 4.69s
Emit Time 2.94s (± 0.83%) 2.92s (± 1.25%) -0.01s (- 0.51%) 2.83s 2.99s
Total Time 9.42s (± 0.38%) 9.44s (± 0.53%) +0.01s (+ 0.14%) 9.34s 9.57s
material-ui - node (v10.16.3, x64)
Memory used 495,626k (± 0.02%) 492,925k (± 0.02%) -2,701k (- 0.54%) 492,805k 493,180k
Parse Time 1.98s (± 0.39%) 1.97s (± 0.91%) -0.01s (- 0.40%) 1.94s 2.02s
Bind Time 0.65s (± 0.95%) 0.65s (± 0.68%) +0.00s (+ 0.15%) 0.64s 0.66s
Check Time 13.95s (± 0.92%) 14.09s (± 0.53%) +0.13s (+ 0.96%) 13.95s 14.29s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.59s (± 0.77%) 16.71s (± 0.53%) +0.12s (+ 0.74%) 16.54s 16.95s
Angular - node (v12.1.0, x64)
Memory used 323,177k (± 0.03%) 323,247k (± 0.04%) +70k (+ 0.02%) 322,964k 323,504k
Parse Time 1.90s (± 0.66%) 1.91s (± 0.75%) +0.01s (+ 0.63%) 1.88s 1.95s
Bind Time 0.80s (± 0.86%) 0.80s (± 0.65%) +0.00s (+ 0.63%) 0.79s 0.81s
Check Time 4.85s (± 0.63%) 4.90s (± 0.45%) +0.05s (+ 1.01%) 4.85s 4.94s
Emit Time 5.40s (± 0.54%) 5.42s (± 0.62%) +0.02s (+ 0.43%) 5.38s 5.53s
Total Time 12.94s (± 0.47%) 13.03s (± 0.39%) +0.09s (+ 0.69%) 12.91s 13.16s
Compiler-Unions - node (v12.1.0, x64)
Memory used 199,902k (± 0.05%) 199,849k (± 0.09%) -52k (- 0.03%) 199,387k 200,138k
Parse Time 0.77s (± 0.67%) 0.77s (± 0.62%) -0.00s (- 0.52%) 0.76s 0.78s
Bind Time 0.50s (± 0.60%) 0.50s (± 0.89%) +0.00s (+ 0.80%) 0.49s 0.51s
Check Time 9.72s (± 1.02%) 10.04s (± 1.16%) +0.32s (+ 3.27%) 9.75s 10.28s
Emit Time 2.34s (± 1.01%) 2.35s (± 1.88%) +0.01s (+ 0.47%) 2.29s 2.48s
Total Time 13.33s (± 0.73%) 13.66s (± 0.95%) +0.33s (+ 2.50%) 13.40s 13.90s
Monaco - node (v12.1.0, x64)
Memory used 337,476k (± 0.01%) 337,528k (± 0.02%) +53k (+ 0.02%) 337,398k 337,674k
Parse Time 1.53s (± 0.87%) 1.54s (± 0.59%) +0.01s (+ 0.92%) 1.52s 1.56s
Bind Time 0.70s (± 0.63%) 0.71s (± 0.52%) +0.00s (+ 0.57%) 0.70s 0.71s
Check Time 4.91s (± 0.48%) 4.97s (± 0.40%) +0.05s (+ 1.06%) 4.92s 5.00s
Emit Time 2.86s (± 0.57%) 2.88s (± 1.08%) +0.02s (+ 0.59%) 2.82s 2.97s
Total Time 10.00s (± 0.32%) 10.09s (± 0.45%) +0.09s (+ 0.87%) 9.99s 10.23s
TFS - node (v12.1.0, x64)
Memory used 292,351k (± 0.01%) 292,418k (± 0.03%) +68k (+ 0.02%) 292,247k 292,607k
Parse Time 1.22s (± 0.69%) 1.22s (± 0.39%) +0.00s (+ 0.16%) 1.21s 1.23s
Bind Time 0.65s (± 0.34%) 0.66s (± 1.16%) +0.00s (+ 0.61%) 0.64s 0.68s
Check Time 4.50s (± 0.40%) 4.53s (± 0.44%) +0.03s (+ 0.64%) 4.50s 4.58s
Emit Time 2.96s (± 0.91%) 2.92s (± 1.06%) -0.03s (- 1.18%) 2.88s 3.03s
Total Time 9.33s (± 0.37%) 9.33s (± 0.51%) -0.00s (- 0.00%) 9.24s 9.46s
material-ui - node (v12.1.0, x64)
Memory used 472,776k (± 0.01%) 470,648k (± 0.01%) -2,128k (- 0.45%) 470,518k 470,738k
Parse Time 1.99s (± 0.51%) 1.99s (± 0.51%) -0.00s (- 0.00%) 1.97s 2.01s
Bind Time 0.64s (± 0.35%) 0.64s (± 0.97%) -0.00s (- 0.31%) 0.63s 0.65s
Check Time 12.49s (± 0.70%) 12.79s (± 0.85%) +0.30s (+ 2.39%) 12.48s 12.98s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.12s (± 0.58%) 15.42s (± 0.73%) +0.30s (+ 1.95%) 15.11s 15.64s
Angular - node (v14.15.1, x64)
Memory used 321,828k (± 0.01%) 321,855k (± 0.01%) +28k (+ 0.01%) 321,800k 321,898k
Parse Time 1.90s (± 0.55%) 1.91s (± 0.52%) +0.01s (+ 0.53%) 1.89s 1.93s
Bind Time 0.84s (± 0.43%) 0.85s (± 0.58%) +0.00s (+ 0.24%) 0.84s 0.86s
Check Time 4.83s (± 0.38%) 4.87s (± 0.40%) +0.04s (+ 0.72%) 4.84s 4.91s
Emit Time 5.48s (± 0.77%) 5.48s (± 0.77%) +0.01s (+ 0.11%) 5.40s 5.61s
Total Time 13.05s (± 0.49%) 13.11s (± 0.42%) +0.05s (+ 0.41%) 12.99s 13.22s
Compiler-Unions - node (v14.15.1, x64)
Memory used 199,870k (± 0.38%) 200,779k (± 0.58%) +909k (+ 0.45%) 199,094k 202,880k
Parse Time 0.79s (± 0.62%) 0.80s (± 0.75%) +0.00s (+ 0.13%) 0.79s 0.81s
Bind Time 0.53s (± 0.42%) 0.53s (± 0.98%) -0.00s (- 0.00%) 0.52s 0.54s
Check Time 9.68s (± 0.56%) 9.93s (± 0.52%) +0.25s (+ 2.58%) 9.78s 10.03s
Emit Time 2.34s (± 1.04%) 2.38s (± 1.37%) +0.04s (+ 1.75%) 2.31s 2.46s
Total Time 13.35s (± 0.48%) 13.64s (± 0.55%) +0.30s (+ 2.21%) 13.50s 13.82s
Monaco - node (v14.15.1, x64)
Memory used 336,849k (± 0.01%) 336,911k (± 0.00%) +62k (+ 0.02%) 336,881k 336,933k
Parse Time 1.55s (± 0.58%) 1.55s (± 0.53%) +0.00s (+ 0.13%) 1.53s 1.57s
Bind Time 0.73s (± 0.71%) 0.73s (± 0.79%) +0.00s (+ 0.55%) 0.72s 0.75s
Check Time 4.85s (± 0.61%) 4.92s (± 0.40%) +0.07s (+ 1.36%) 4.88s 4.97s
Emit Time 2.91s (± 0.41%) 2.90s (± 0.94%) -0.01s (- 0.31%) 2.85s 2.98s
Total Time 10.05s (± 0.39%) 10.11s (± 0.40%) +0.06s (+ 0.59%) 10.04s 10.22s
TFS - node (v14.15.1, x64)
Memory used 291,545k (± 0.00%) 291,577k (± 0.01%) +32k (+ 0.01%) 291,533k 291,621k
Parse Time 1.24s (± 0.99%) 1.25s (± 0.81%) +0.00s (+ 0.24%) 1.23s 1.28s
Bind Time 0.69s (± 0.64%) 0.69s (± 0.90%) -0.00s (- 0.43%) 0.68s 0.71s
Check Time 4.50s (± 0.62%) 4.52s (± 0.37%) +0.02s (+ 0.53%) 4.48s 4.56s
Emit Time 3.03s (± 0.46%) 3.05s (± 0.41%) +0.01s (+ 0.46%) 3.03s 3.07s
Total Time 9.46s (± 0.30%) 9.50s (± 0.34%) +0.04s (+ 0.41%) 9.43s 9.59s
material-ui - node (v14.15.1, x64)
Memory used 471,401k (± 0.06%) 469,275k (± 0.06%) -2,126k (- 0.45%) 468,229k 469,436k
Parse Time 2.06s (± 0.78%) 2.05s (± 0.70%) -0.00s (- 0.15%) 2.01s 2.09s
Bind Time 0.70s (± 0.74%) 0.70s (± 0.92%) +0.00s (+ 0.14%) 0.69s 0.72s
Check Time 12.63s (± 0.83%) 12.92s (± 0.97%) +0.29s (+ 2.29%) 12.78s 13.33s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.38s (± 0.75%) 15.67s (± 0.80%) +0.28s (+ 1.85%) 15.53s 16.08s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-198-generic
Architecturex64
Available Memory16 GB
Available Memory8 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)
Benchmark Name Iterations
Current 42727 10
Baseline master 10

@weswigham weswigham merged commit 6da2625 into microsoft:master Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Unexpected very poor performance
4 participants