Conversation

ahejlsberg

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

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

@typescript-bot

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

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

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

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

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

@ahejlsberg

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

@typescript-bot

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

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

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

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.

@ahejlsbergahejlsberg requested a review from amcasey February 4, 2020 21:34
@typescript-bot

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

Here they are:

Comparison Report - master..36607

Metricmaster36607DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used356,421k (± 0.01%)358,155k (± 0.02%)+1,735k (+ 0.49%)358,014k358,397k
Parse Time1.60s (± 0.50%)1.61s (± 0.71%)+0.01s (+ 0.69%)1.60s1.65s
Bind Time0.89s (± 0.77%)0.88s (± 0.92%)-0.00s (- 0.56%)0.86s0.90s
Check Time4.65s (± 0.54%)4.67s (± 0.58%)+0.02s (+ 0.34%)4.61s4.73s
Emit Time5.18s (± 0.52%)5.19s (± 0.52%)+0.01s (+ 0.19%)5.16s5.26s
Total Time12.32s (± 0.42%)12.35s (± 0.41%)+0.03s (+ 0.23%)12.27s12.47s
Monaco - node (v10.16.3, x64)
Memory used364,637k (± 0.01%)364,628k (± 0.02%)-9k (- 0.00%)364,490k364,781k
Parse Time1.24s (± 0.77%)1.25s (± 0.40%)+0.00s (+ 0.08%)1.24s1.26s
Bind Time0.78s (± 0.48%)0.77s (± 0.58%)-0.00s (- 0.39%)0.76s0.78s
Check Time4.69s (± 0.48%)4.67s (± 0.30%)-0.02s (- 0.41%)4.65s4.71s
Emit Time2.90s (± 0.46%)2.89s (± 0.85%)-0.01s (- 0.28%)2.85s2.97s
Total Time9.61s (± 0.34%)9.58s (± 0.35%)-0.03s (- 0.30%)9.53s9.69s
TFS - node (v10.16.3, x64)
Memory used324,095k (± 0.01%)324,224k (± 0.09%)+130k (+ 0.04%)323,979k325,312k
Parse Time0.95s (± 0.70%)0.94s (± 0.36%)-0.01s (- 0.74%)0.94s0.95s
Bind Time0.75s (± 1.00%)0.74s (± 1.31%)-0.01s (- 1.07%)0.72s0.76s
Check Time4.25s (± 0.48%)4.23s (± 0.58%)-0.02s (- 0.56%)4.18s4.29s
Emit Time3.04s (± 0.82%)3.01s (± 0.79%)-0.03s (- 0.92%)2.95s3.05s
Total Time8.98s (± 0.39%)8.92s (± 0.37%)-0.07s (- 0.73%)8.84s8.99s
Angular - node (v12.1.0, x64)
Memory used332,321k (± 0.02%)333,844k (± 0.01%)+1,523k (+ 0.46%)333,736k333,935k
Parse Time1.56s (± 0.51%)1.56s (± 0.43%)+0.00s (+ 0.32%)1.55s1.58s
Bind Time0.86s (± 0.77%)0.87s (± 0.64%)+0.01s (+ 0.58%)0.86s0.88s
Check Time4.57s (± 0.59%)4.57s (± 0.57%)-0.00s (- 0.04%)4.52s4.64s
Emit Time5.37s (± 0.62%)5.38s (± 0.68%)+0.01s (+ 0.20%)5.31s5.46s
Total Time12.37s (± 0.24%)12.39s (± 0.33%)+0.02s (+ 0.17%)12.31s12.49s
Monaco - node (v12.1.0, x64)
Memory used344,524k (± 0.02%)344,487k (± 0.01%)-37k (- 0.01%)344,406k344,535k
Parse Time1.21s (± 0.55%)1.21s (± 0.58%)-0.00s (- 0.08%)1.20s1.23s
Bind Time0.75s (± 0.89%)0.74s (± 0.64%)-0.01s (- 0.93%)0.73s0.75s
Check Time4.54s (± 0.55%)4.56s (± 0.39%)+0.01s (+ 0.24%)4.50s4.58s
Emit Time2.96s (± 1.17%)2.97s (± 0.74%)+0.01s (+ 0.30%)2.94s3.03s
Total Time9.47s (± 0.51%)9.48s (± 0.36%)+0.01s (+ 0.11%)9.40s9.55s
TFS - node (v12.1.0, x64)
Memory used306,373k (± 0.01%)306,425k (± 0.02%)+51k (+ 0.02%)306,337k306,600k
Parse Time0.94s (± 0.55%)0.94s (± 0.50%)+0.00s (+ 0.11%)0.93s0.95s
Bind Time0.71s (± 0.85%)0.70s (± 0.48%)-0.00s (- 0.28%)0.70s0.71s
Check Time4.18s (± 0.51%)4.20s (± 0.61%)+0.02s (+ 0.48%)4.13s4.26s
Emit Time3.05s (± 0.73%)3.07s (± 0.59%)+0.02s (+ 0.56%)3.02s3.10s
Total Time8.87s (± 0.48%)8.91s (± 0.40%)+0.04s (+ 0.44%)8.86s9.01s
Angular - node (v8.9.0, x64)
Memory used351,509k (± 0.01%)353,139k (± 0.01%)+1,630k (+ 0.46%)353,047k353,241k
Parse Time2.10s (± 0.48%)2.11s (± 0.52%)+0.02s (+ 0.81%)2.08s2.13s
Bind Time0.92s (± 0.92%)0.93s (± 0.60%)+0.01s (+ 1.19%)0.92s0.94s
Check Time5.46s (± 0.64%)5.39s (± 0.48%)-0.07s (- 1.25%)5.33s5.45s
Emit Time6.21s (± 0.73%)6.22s (± 0.93%)+0.01s (+ 0.18%)6.15s6.38s
Total Time14.69s (± 0.46%)14.65s (± 0.43%)-0.03s (- 0.23%)14.55s14.81s
Monaco - node (v8.9.0, x64)
Memory used362,875k (± 0.01%)362,882k (± 0.01%)+7k (+ 0.00%)362,749k363,001k
Parse Time1.56s (± 0.72%)1.55s (± 0.38%)-0.00s (- 0.06%)1.54s1.57s
Bind Time0.95s (± 0.70%)0.95s (± 0.70%)+0.00s (+ 0.32%)0.94s0.97s
Check Time5.41s (± 1.58%)5.34s (± 0.90%)-0.06s (- 1.18%)5.30s5.51s
Emit Time3.23s (± 4.81%)3.36s (± 3.10%)+0.13s (+ 3.96%)2.97s3.49s
Total Time11.15s (± 0.89%)11.21s (± 0.73%)+0.06s (+ 0.53%)10.99s11.43s
TFS - node (v8.9.0, x64)
Memory used323,458k (± 0.01%)323,440k (± 0.02%)-18k (- 0.01%)323,365k323,566k
Parse Time1.25s (± 0.30%)1.26s (± 0.70%)+0.01s (+ 0.64%)1.25s1.28s
Bind Time0.76s (± 0.59%)0.76s (± 0.91%)-0.00s (- 0.40%)0.74s0.77s
Check Time4.83s (± 0.49%)4.82s (± 0.94%)-0.01s (- 0.27%)4.74s4.94s
Emit Time3.19s (± 0.71%)3.19s (± 0.61%)-0.00s (- 0.09%)3.15s3.23s
Total Time10.04s (± 0.34%)10.02s (± 0.61%)-0.01s (- 0.14%)9.90s10.14s
Angular - node (v8.9.0, x86)
Memory used199,873k (± 0.03%)200,712k (± 0.03%)+839k (+ 0.42%)200,617k200,883k
Parse Time2.03s (± 0.58%)2.04s (± 0.53%)+0.01s (+ 0.34%)2.01s2.06s
Bind Time1.04s (± 0.78%)1.06s (± 0.47%)+0.01s (+ 1.25%)1.05s1.07s
Check Time4.97s (± 0.37%)4.93s (± 0.51%)-0.04s (- 0.72%)4.87s4.98s
Emit Time6.09s (± 1.90%)6.10s (± 1.71%)+0.01s (+ 0.13%)5.92s6.31s
Total Time14.13s (± 0.93%)14.13s (± 0.80%)-0.01s (- 0.05%)13.93s14.39s
Monaco - node (v8.9.0, x86)
Memory used203,723k (± 0.02%)203,723k (± 0.02%)+1k (+ 0.00%)203,609k203,815k
Parse Time1.60s (± 0.93%)1.61s (± 0.46%)+0.00s (+ 0.12%)1.59s1.62s
Bind Time0.77s (± 0.78%)0.77s (± 1.56%)+0.00s (+ 0.52%)0.76s0.81s
Check Time5.16s (± 1.38%)5.14s (± 0.83%)-0.02s (- 0.43%)5.07s5.24s
Emit Time3.13s (± 2.59%)3.16s (± 1.15%)+0.03s (+ 0.96%)3.07s3.22s
Total Time10.67s (± 0.57%)10.68s (± 0.27%)+0.01s (+ 0.12%)10.60s10.74s
TFS - node (v8.9.0, x86)
Memory used182,614k (± 0.03%)182,570k (± 0.01%)-44k (- 0.02%)182,529k182,629k
Parse Time1.31s (± 1.09%)1.30s (± 0.44%)-0.00s (- 0.38%)1.28s1.31s
Bind Time0.71s (± 0.99%)0.71s (± 1.15%)+0.00s (+ 0.14%)0.70s0.73s
Check Time4.54s (± 0.50%)4.57s (± 0.41%)+0.03s (+ 0.59%)4.53s4.61s
Emit Time2.97s (± 0.73%)2.95s (± 1.03%)-0.02s (- 0.77%)2.84s3.00s
Total Time9.53s (± 0.33%)9.53s (± 0.41%)0.00s ( 0.00%)9.39s9.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)
BenchmarkNameIterations
Current3660710
Baselinemaster10

@ahejlsberg

@typescript-bot run dt

@typescript-bot

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

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

@amcasey

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

@ahejlsbergahejlsberg merged commit de37c87 into master Feb 6, 2020
@jakebaileyjakebailey deleted the optimizeDeferredTypeReferences branch November 7, 2022 17:35
Sign up for free to join this conversation on . Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

Performance regressions from recursive type reference support