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

Optimize deferred type references #36607

Merged
merged 4 commits into from
Feb 6, 2020
Merged

Conversation

ahejlsberg
Copy link
Member

@ahejlsberg ahejlsberg commented Feb 4, 2020

This PR improves our reasoning about when to (and, more importantly, when not to) create deferred type references. We now create fewer deferred type references which improves overall compile times for the repro in #36566 by around 4%.

Fixes #36566.

@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 Feb 4, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 4, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 4, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 4, 2020

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

@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

@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 Feb 4, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 4, 2020

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

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 4, 2020

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

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..36607

Metric master 36607 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 356,421k (± 0.01%) 358,155k (± 0.02%) +1,735k (+ 0.49%) 358,014k 358,397k
Parse Time 1.60s (± 0.50%) 1.61s (± 0.71%) +0.01s (+ 0.69%) 1.60s 1.65s
Bind Time 0.89s (± 0.77%) 0.88s (± 0.92%) -0.00s (- 0.56%) 0.86s 0.90s
Check Time 4.65s (± 0.54%) 4.67s (± 0.58%) +0.02s (+ 0.34%) 4.61s 4.73s
Emit Time 5.18s (± 0.52%) 5.19s (± 0.52%) +0.01s (+ 0.19%) 5.16s 5.26s
Total Time 12.32s (± 0.42%) 12.35s (± 0.41%) +0.03s (+ 0.23%) 12.27s 12.47s
Monaco - node (v10.16.3, x64)
Memory used 364,637k (± 0.01%) 364,628k (± 0.02%) -9k (- 0.00%) 364,490k 364,781k
Parse Time 1.24s (± 0.77%) 1.25s (± 0.40%) +0.00s (+ 0.08%) 1.24s 1.26s
Bind Time 0.78s (± 0.48%) 0.77s (± 0.58%) -0.00s (- 0.39%) 0.76s 0.78s
Check Time 4.69s (± 0.48%) 4.67s (± 0.30%) -0.02s (- 0.41%) 4.65s 4.71s
Emit Time 2.90s (± 0.46%) 2.89s (± 0.85%) -0.01s (- 0.28%) 2.85s 2.97s
Total Time 9.61s (± 0.34%) 9.58s (± 0.35%) -0.03s (- 0.30%) 9.53s 9.69s
TFS - node (v10.16.3, x64)
Memory used 324,095k (± 0.01%) 324,224k (± 0.09%) +130k (+ 0.04%) 323,979k 325,312k
Parse Time 0.95s (± 0.70%) 0.94s (± 0.36%) -0.01s (- 0.74%) 0.94s 0.95s
Bind Time 0.75s (± 1.00%) 0.74s (± 1.31%) -0.01s (- 1.07%) 0.72s 0.76s
Check Time 4.25s (± 0.48%) 4.23s (± 0.58%) -0.02s (- 0.56%) 4.18s 4.29s
Emit Time 3.04s (± 0.82%) 3.01s (± 0.79%) -0.03s (- 0.92%) 2.95s 3.05s
Total Time 8.98s (± 0.39%) 8.92s (± 0.37%) -0.07s (- 0.73%) 8.84s 8.99s
Angular - node (v12.1.0, x64)
Memory used 332,321k (± 0.02%) 333,844k (± 0.01%) +1,523k (+ 0.46%) 333,736k 333,935k
Parse Time 1.56s (± 0.51%) 1.56s (± 0.43%) +0.00s (+ 0.32%) 1.55s 1.58s
Bind Time 0.86s (± 0.77%) 0.87s (± 0.64%) +0.01s (+ 0.58%) 0.86s 0.88s
Check Time 4.57s (± 0.59%) 4.57s (± 0.57%) -0.00s (- 0.04%) 4.52s 4.64s
Emit Time 5.37s (± 0.62%) 5.38s (± 0.68%) +0.01s (+ 0.20%) 5.31s 5.46s
Total Time 12.37s (± 0.24%) 12.39s (± 0.33%) +0.02s (+ 0.17%) 12.31s 12.49s
Monaco - node (v12.1.0, x64)
Memory used 344,524k (± 0.02%) 344,487k (± 0.01%) -37k (- 0.01%) 344,406k 344,535k
Parse Time 1.21s (± 0.55%) 1.21s (± 0.58%) -0.00s (- 0.08%) 1.20s 1.23s
Bind Time 0.75s (± 0.89%) 0.74s (± 0.64%) -0.01s (- 0.93%) 0.73s 0.75s
Check Time 4.54s (± 0.55%) 4.56s (± 0.39%) +0.01s (+ 0.24%) 4.50s 4.58s
Emit Time 2.96s (± 1.17%) 2.97s (± 0.74%) +0.01s (+ 0.30%) 2.94s 3.03s
Total Time 9.47s (± 0.51%) 9.48s (± 0.36%) +0.01s (+ 0.11%) 9.40s 9.55s
TFS - node (v12.1.0, x64)
Memory used 306,373k (± 0.01%) 306,425k (± 0.02%) +51k (+ 0.02%) 306,337k 306,600k
Parse Time 0.94s (± 0.55%) 0.94s (± 0.50%) +0.00s (+ 0.11%) 0.93s 0.95s
Bind Time 0.71s (± 0.85%) 0.70s (± 0.48%) -0.00s (- 0.28%) 0.70s 0.71s
Check Time 4.18s (± 0.51%) 4.20s (± 0.61%) +0.02s (+ 0.48%) 4.13s 4.26s
Emit Time 3.05s (± 0.73%) 3.07s (± 0.59%) +0.02s (+ 0.56%) 3.02s 3.10s
Total Time 8.87s (± 0.48%) 8.91s (± 0.40%) +0.04s (+ 0.44%) 8.86s 9.01s
Angular - node (v8.9.0, x64)
Memory used 351,509k (± 0.01%) 353,139k (± 0.01%) +1,630k (+ 0.46%) 353,047k 353,241k
Parse Time 2.10s (± 0.48%) 2.11s (± 0.52%) +0.02s (+ 0.81%) 2.08s 2.13s
Bind Time 0.92s (± 0.92%) 0.93s (± 0.60%) +0.01s (+ 1.19%) 0.92s 0.94s
Check Time 5.46s (± 0.64%) 5.39s (± 0.48%) -0.07s (- 1.25%) 5.33s 5.45s
Emit Time 6.21s (± 0.73%) 6.22s (± 0.93%) +0.01s (+ 0.18%) 6.15s 6.38s
Total Time 14.69s (± 0.46%) 14.65s (± 0.43%) -0.03s (- 0.23%) 14.55s 14.81s
Monaco - node (v8.9.0, x64)
Memory used 362,875k (± 0.01%) 362,882k (± 0.01%) +7k (+ 0.00%) 362,749k 363,001k
Parse Time 1.56s (± 0.72%) 1.55s (± 0.38%) -0.00s (- 0.06%) 1.54s 1.57s
Bind Time 0.95s (± 0.70%) 0.95s (± 0.70%) +0.00s (+ 0.32%) 0.94s 0.97s
Check Time 5.41s (± 1.58%) 5.34s (± 0.90%) -0.06s (- 1.18%) 5.30s 5.51s
Emit Time 3.23s (± 4.81%) 3.36s (± 3.10%) +0.13s (+ 3.96%) 2.97s 3.49s
Total Time 11.15s (± 0.89%) 11.21s (± 0.73%) +0.06s (+ 0.53%) 10.99s 11.43s
TFS - node (v8.9.0, x64)
Memory used 323,458k (± 0.01%) 323,440k (± 0.02%) -18k (- 0.01%) 323,365k 323,566k
Parse Time 1.25s (± 0.30%) 1.26s (± 0.70%) +0.01s (+ 0.64%) 1.25s 1.28s
Bind Time 0.76s (± 0.59%) 0.76s (± 0.91%) -0.00s (- 0.40%) 0.74s 0.77s
Check Time 4.83s (± 0.49%) 4.82s (± 0.94%) -0.01s (- 0.27%) 4.74s 4.94s
Emit Time 3.19s (± 0.71%) 3.19s (± 0.61%) -0.00s (- 0.09%) 3.15s 3.23s
Total Time 10.04s (± 0.34%) 10.02s (± 0.61%) -0.01s (- 0.14%) 9.90s 10.14s
Angular - node (v8.9.0, x86)
Memory used 199,873k (± 0.03%) 200,712k (± 0.03%) +839k (+ 0.42%) 200,617k 200,883k
Parse Time 2.03s (± 0.58%) 2.04s (± 0.53%) +0.01s (+ 0.34%) 2.01s 2.06s
Bind Time 1.04s (± 0.78%) 1.06s (± 0.47%) +0.01s (+ 1.25%) 1.05s 1.07s
Check Time 4.97s (± 0.37%) 4.93s (± 0.51%) -0.04s (- 0.72%) 4.87s 4.98s
Emit Time 6.09s (± 1.90%) 6.10s (± 1.71%) +0.01s (+ 0.13%) 5.92s 6.31s
Total Time 14.13s (± 0.93%) 14.13s (± 0.80%) -0.01s (- 0.05%) 13.93s 14.39s
Monaco - node (v8.9.0, x86)
Memory used 203,723k (± 0.02%) 203,723k (± 0.02%) +1k (+ 0.00%) 203,609k 203,815k
Parse Time 1.60s (± 0.93%) 1.61s (± 0.46%) +0.00s (+ 0.12%) 1.59s 1.62s
Bind Time 0.77s (± 0.78%) 0.77s (± 1.56%) +0.00s (+ 0.52%) 0.76s 0.81s
Check Time 5.16s (± 1.38%) 5.14s (± 0.83%) -0.02s (- 0.43%) 5.07s 5.24s
Emit Time 3.13s (± 2.59%) 3.16s (± 1.15%) +0.03s (+ 0.96%) 3.07s 3.22s
Total Time 10.67s (± 0.57%) 10.68s (± 0.27%) +0.01s (+ 0.12%) 10.60s 10.74s
TFS - node (v8.9.0, x86)
Memory used 182,614k (± 0.03%) 182,570k (± 0.01%) -44k (- 0.02%) 182,529k 182,629k
Parse Time 1.31s (± 1.09%) 1.30s (± 0.44%) -0.00s (- 0.38%) 1.28s 1.31s
Bind Time 0.71s (± 0.99%) 0.71s (± 1.15%) +0.00s (+ 0.14%) 0.70s 0.73s
Check Time 4.54s (± 0.50%) 4.57s (± 0.41%) +0.03s (+ 0.59%) 4.53s 4.61s
Emit Time 2.97s (± 0.73%) 2.95s (± 1.03%) -0.02s (- 0.77%) 2.84s 3.00s
Total Time 9.53s (± 0.33%) 9.53s (± 0.41%) 0.00s ( 0.00%) 9.39s 9.59s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory4 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 36607 10
Baseline master 10

@ahejlsberg
Copy link
Member Author

@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 4, 2020

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

@ahejlsberg
Copy link
Member Author

Tests look clean. Only change is a minor type ordering difference in a few error messages in RWC.

@amcasey
Copy link
Member

amcasey commented Feb 4, 2020

10-run average from the original machine shows a 5% improvement. Very nice!

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.

Performance regressions from recursive type reference support
4 participants