Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reuse Printers with common options#52382

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jakebailey merged 17 commits intomicrosoft:mainfromjakebailey:pooled-printers
Jan 25, 2023

Conversation

jakebailey
Copy link
Member

In#52350 I noticed thatdeclarationEmitPrivatePromiseLikeInterface was running quite slowly.

I ran this single test through pprof and found that 20% of the time is spent just doingcreatePrinter.

image

With this change, the test goes from ~6s to ~4s on my machine, and now that call is gone:

image

It seems to me like we have a lot of printers created with static options, although I'm guessing a lot aren't in a hot path like this one.

DanielRosenwasser reacted with heart emoji
@typescript-bottypescript-bot added Author: Team For Uncommitted BugPR for untriaged, rejected, closed or missing bug labelsJan 24, 2023
@jakebailey
Copy link
MemberAuthor

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 24, 2023
edited
Loading

Heya@jakebailey, I've started to run the perf test suite on this PR atcd3afe4. You can monitor the buildhere.

Update:The results are in!

@jakebaileyjakebailey changed the title[experiment] Pool Printers for reuse[experiment] Reuse PrintersJan 24, 2023
@jakebailey
Copy link
MemberAuthor

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 24, 2023
edited
Loading

Heya@jakebailey, I've started to run the perf test suite on this PR at6d99c8f. You can monitor the buildhere.

Update:The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..52382
Metricmain52382DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used359,659k (± 0.01%)359,823k (± 0.01%)+165k (+ 0.05%)359,786k359,899k
Parse Time3.93s (± 0.79%)3.97s (± 0.67%)+0.04s (+ 0.98%)3.93s4.01s
Bind Time1.17s (± 0.44%)1.17s (± 0.47%)+0.00s (+ 0.14%)1.17s1.18s
Check Time8.86s (± 0.35%)8.86s (± 0.44%)+0.01s (+ 0.08%)8.84s8.94s
Emit Time7.62s (± 0.84%)7.60s (± 0.68%)-0.01s (- 0.18%)7.52s7.67s
Total Time21.57s (± 0.49%)21.61s (± 0.49%)+0.03s (+ 0.15%)21.49s21.79s
Compiler-Unions - node (v18.10.0, x64)
Memory used193,506k (± 1.17%)194,544k (± 1.52%)+1,038k (+ 0.54%)192,586k198,420k
Parse Time1.63s (± 1.81%)1.64s (± 2.06%)+0.01s (+ 0.72%)1.59s1.68s
Bind Time0.79s (± 0.65%)0.79s (± 0.65%)0.00s ( 0.00%)0.79s0.80s
Check Time9.66s (± 0.53%)9.71s (± 0.57%)+0.06s (+ 0.59%)9.67s9.80s
Emit Time2.80s (± 1.55%)2.81s (± 1.06%)+0.01s (+ 0.36%)2.78s2.85s
Total Time14.88s (± 0.48%)14.95s (± 0.34%)+0.08s (+ 0.50%)14.88s15.02s
Monaco - node (v18.10.0, x64)
Memory used343,954k (± 0.01%)344,048k (± 0.01%)+94k (+ 0.03%)343,982k344,090k
Parse Time2.95s (± 0.55%)2.95s (± 0.89%)+0.00s (+ 0.17%)2.92s3.00s
Bind Time1.04s (± 1.17%)1.04s (± 1.22%)+0.00s (+ 0.32%)1.02s1.05s
Check Time7.30s (± 0.46%)7.27s (± 0.28%)-0.02s (- 0.32%)7.24s7.30s
Emit Time4.36s (± 0.65%)4.34s (± 0.83%)-0.02s (- 0.34%)4.31s4.39s
Total Time15.64s (± 0.42%)15.61s (± 0.28%)-0.03s (- 0.21%)15.54s15.66s
TFS - node (v18.10.0, x64)
Memory used300,338k (± 0.01%)300,337k (± 0.00%)-1k (- 0.00%)300,322k300,360k
Parse Time2.26s (± 1.30%)2.29s (± 2.60%)+0.03s (+ 1.26%)2.22s2.36s
Bind Time1.17s (± 0.47%)1.17s (± 0.88%)+0.01s (+ 0.72%)1.16s1.19s
Check Time6.89s (± 0.52%)6.93s (± 0.27%)+0.03s (+ 0.46%)6.91s6.96s
Emit Time3.93s (± 0.84%)3.97s (± 0.60%)+0.04s (+ 1.10%)3.95s4.01s
Total Time14.24s (± 0.50%)14.36s (± 0.51%)+0.12s (+ 0.83%)14.27s14.44s
material-ui - node (v18.10.0, x64)
Memory used476,775k (± 0.02%)476,816k (± 0.00%)+41k (+ 0.01%)476,796k476,858k
Parse Time3.57s (± 0.46%)3.57s (± 0.46%)+0.00s (+ 0.05%)3.56s3.59s
Bind Time0.96s (± 0.57%)0.97s (± 0.42%)+0.00s (+ 0.35%)0.96s0.97s
Check Time17.14s (± 1.11%)17.10s (± 0.45%)-0.04s (- 0.23%)17.04s17.25s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time21.68s (± 0.84%)21.65s (± 0.36%)-0.03s (- 0.15%)21.59s21.80s
xstate - node (v18.10.0, x64)
Memory used548,713k (± 0.02%)548,748k (± 0.01%)+35k (+ 0.01%)548,639k548,861k
Parse Time4.58s (± 0.56%)4.58s (± 0.56%)+0.00s (+ 0.11%)4.56s4.62s
Bind Time1.71s (± 0.68%)1.71s (± 0.91%)-0.00s (- 0.10%)1.68s1.72s
Check Time2.73s (± 0.46%)2.73s (± 0.38%)+0.00s (+ 0.12%)2.72s2.75s
Emit Time0.08s (± 4.99%)0.08s (± 4.99%)+0.00s (+ 0.00%)0.08s0.09s
Total Time9.11s (± 0.37%)9.12s (± 0.38%)+0.01s (+ 0.11%)9.06s9.15s
Angular - node (v16.17.1, x64)
Memory used359,034k (± 0.01%)359,229k (± 0.01%)+196k (+ 0.05%)359,200k359,280k
Parse Time4.18s (± 0.29%)4.18s (± 0.29%)0.00s ( 0.00%)4.16s4.19s
Bind Time1.22s (± 0.62%)1.23s (± 0.45%)+0.00s (+ 0.27%)1.22s1.23s
Check Time9.55s (± 0.37%)9.58s (± 0.36%)+0.03s (+ 0.33%)9.54s9.64s
Emit Time8.10s (± 0.64%)8.13s (± 0.57%)+0.04s (+ 0.45%)8.04s8.17s
Total Time23.04s (± 0.35%)23.12s (± 0.30%)+0.08s (+ 0.34%)23.02s23.23s
Compiler-Unions - node (v16.17.1, x64)
Memory used194,229k (± 0.03%)194,338k (± 0.04%)+109k (+ 0.06%)194,209k194,421k
Parse Time1.80s (± 0.45%)1.80s (± 0.46%)+0.01s (+ 0.46%)1.80s1.82s
Bind Time0.85s (± 0.65%)0.84s (± 0.75%)-0.01s (- 0.59%)0.83s0.85s
Check Time10.35s (± 0.36%)10.37s (± 0.39%)+0.03s (+ 0.24%)10.33s10.42s
Emit Time3.04s (± 0.79%)3.06s (± 0.64%)+0.02s (+ 0.71%)3.04s3.09s
Total Time16.03s (± 0.40%)16.08s (± 0.25%)+0.05s (+ 0.32%)16.02s16.13s
Monaco - node (v16.17.1, x64)
Memory used343,223k (± 0.01%)343,317k (± 0.01%)+94k (+ 0.03%)343,254k343,363k
Parse Time3.16s (± 0.94%)3.15s (± 1.11%)-0.01s (- 0.21%)3.10s3.20s
Bind Time1.11s (± 0.47%)1.11s (± 1.05%)+0.01s (+ 0.45%)1.09s1.12s
Check Time7.89s (± 0.33%)7.92s (± 0.28%)+0.03s (+ 0.36%)7.89s7.95s
Emit Time4.56s (± 0.33%)4.57s (± 0.51%)+0.01s (+ 0.22%)4.54s4.61s
Total Time16.72s (± 0.13%)16.75s (± 0.32%)+0.03s (+ 0.18%)16.67s16.82s
TFS - node (v16.17.1, x64)
Memory used299,690k (± 0.00%)299,709k (± 0.01%)+19k (+ 0.01%)299,687k299,746k
Parse Time2.45s (± 0.82%)2.47s (± 1.10%)+0.02s (+ 0.75%)2.44s2.51s
Bind Time1.25s (± 0.44%)1.26s (± 0.93%)+0.00s (+ 0.27%)1.24s1.27s
Check Time7.50s (± 0.28%)7.53s (± 0.28%)+0.04s (+ 0.49%)7.50s7.55s
Emit Time4.24s (± 0.68%)4.26s (± 0.83%)+0.02s (+ 0.47%)4.20s4.29s
Total Time15.44s (± 0.26%)15.52s (± 0.45%)+0.07s (+ 0.46%)15.38s15.57s
material-ui - node (v16.17.1, x64)
Memory used476,074k (± 0.01%)476,178k (± 0.02%)+104k (+ 0.02%)476,052k476,284k
Parse Time3.72s (± 0.33%)3.72s (± 0.52%)+0.01s (+ 0.18%)3.69s3.75s
Bind Time1.02s (± 0.51%)1.02s (± 0.00%)+0.00s (+ 0.33%)1.02s1.02s
Check Time18.12s (± 0.75%)18.13s (± 0.56%)+0.01s (+ 0.05%)17.97s18.23s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.86s (± 0.62%)22.88s (± 0.45%)+0.02s (+ 0.07%)22.71s22.98s
xstate - node (v16.17.1, x64)
Memory used546,268k (± 0.02%)546,475k (± 0.03%)+206k (+ 0.04%)546,314k546,825k
Parse Time4.76s (± 0.37%)4.78s (± 0.39%)+0.02s (+ 0.42%)4.76s4.81s
Bind Time1.85s (± 0.34%)1.85s (± 0.53%)-0.00s (- 0.09%)1.83s1.86s
Check Time2.96s (± 0.66%)2.97s (± 0.51%)+0.01s (+ 0.34%)2.94s2.98s
Emit Time0.09s (± 5.53%)0.10s (± 5.76%)+0.00s (+ 1.79%)0.09s0.10s
Total Time9.66s (± 0.33%)9.69s (± 0.13%)+0.03s (+ 0.35%)9.67s9.71s
Angular - node (v14.15.1, x64)
Memory used352,673k (± 0.01%)352,877k (± 0.01%)+204k (+ 0.06%)352,853k352,896k
Parse Time4.23s (± 0.49%)4.22s (± 0.41%)-0.01s (- 0.28%)4.19s4.24s
Bind Time1.28s (± 0.49%)1.28s (± 0.65%)+0.00s (+ 0.39%)1.28s1.30s
Check Time9.83s (± 0.33%)9.88s (± 0.57%)+0.04s (+ 0.44%)9.81s9.97s
Emit Time8.35s (± 0.28%)8.41s (± 0.36%)+0.06s (+ 0.74%)8.38s8.44s
Total Time23.71s (± 0.14%)23.80s (± 0.32%)+0.09s (+ 0.40%)23.72s23.93s
Compiler-Unions - node (v14.15.1, x64)
Memory used189,732k (± 0.67%)189,729k (± 0.69%)-3k (- 0.00%)189,083k192,387k
Parse Time1.84s (± 0.64%)1.84s (± 0.57%)+0.01s (+ 0.36%)1.83s1.86s
Bind Time0.85s (± 0.64%)0.86s (± 0.94%)+0.01s (+ 0.97%)0.85s0.87s
Check Time10.42s (± 0.38%)10.41s (± 0.59%)-0.00s (- 0.02%)10.33s10.52s
Emit Time3.34s (± 4.90%)3.41s (± 3.79%)+0.07s (+ 2.00%)3.15s3.50s
Total Time16.45s (± 0.95%)16.53s (± 0.97%)+0.08s (+ 0.48%)16.21s16.65s
Monaco - node (v14.15.1, x64)
Memory used337,999k (± 0.00%)338,098k (± 0.00%)+99k (+ 0.03%)338,080k338,106k
Parse Time3.21s (± 0.60%)3.21s (± 1.39%)+0.00s (+ 0.05%)3.17s3.30s
Bind Time1.11s (± 0.50%)1.11s (± 0.94%)+0.01s (+ 0.90%)1.10s1.13s
Check Time8.26s (± 0.36%)8.26s (± 0.55%)+0.01s (+ 0.10%)8.22s8.35s
Emit Time4.78s (± 0.59%)4.80s (± 0.63%)+0.02s (+ 0.49%)4.77s4.86s
Total Time17.35s (± 0.25%)17.39s (± 0.37%)+0.04s (+ 0.21%)17.31s17.50s
TFS - node (v14.15.1, x64)
Memory used294,507k (± 0.00%)294,537k (± 0.01%)+30k (+ 0.01%)294,518k294,568k
Parse Time2.75s (± 0.70%)2.75s (± 0.78%)-0.00s (- 0.12%)2.71s2.77s
Bind Time1.11s (± 0.99%)1.11s (± 0.68%)+0.00s (+ 0.15%)1.10s1.12s
Check Time7.80s (± 0.25%)7.83s (± 0.46%)+0.04s (+ 0.47%)7.79s7.87s
Emit Time4.62s (± 0.37%)4.62s (± 1.00%)+0.00s (+ 0.04%)4.59s4.71s
Total Time16.28s (± 0.18%)16.32s (± 0.39%)+0.04s (+ 0.21%)16.26s16.44s
material-ui - node (v14.15.1, x64)
Memory used471,508k (± 0.00%)471,564k (± 0.00%)+56k (+ 0.01%)471,531k471,588k
Parse Time3.92s (± 0.28%)3.94s (± 0.57%)+0.02s (+ 0.60%)3.92s3.98s
Bind Time1.05s (± 0.49%)1.04s (± 0.52%)-0.00s (- 0.16%)1.04s1.05s
Check Time19.00s (± 0.54%)18.98s (± 0.25%)-0.02s (- 0.09%)18.91s19.05s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time23.97s (± 0.40%)23.97s (± 0.20%)+0.00s (+ 0.01%)23.92s24.03s
xstate - node (v14.15.1, x64)
Memory used534,331k (± 0.01%)534,521k (± 0.00%)+191k (+ 0.04%)534,495k534,563k
Parse Time5.14s (± 0.83%)5.17s (± 0.90%)+0.03s (+ 0.52%)5.11s5.22s
Bind Time1.71s (± 0.64%)1.72s (± 0.47%)+0.01s (+ 0.78%)1.71s1.73s
Check Time3.09s (± 0.52%)3.09s (± 0.86%)+0.00s (+ 0.05%)3.06s3.12s
Emit Time0.10s (± 0.00%)0.10s (± 4.01%)+0.00s (+ 1.67%)0.10s0.11s
Total Time10.04s (± 0.49%)10.08s (± 0.66%)+0.04s (+ 0.43%)10.01s10.15s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

TSServer

Comparison Report - main..52382
Metricmain52382DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,500ms (± 1.25%)2,512ms (± 1.42%)+12ms (+ 0.47%)2,471ms2,546ms
Req 2 - geterr5,502ms (± 0.46%)5,517ms (± 0.38%)+16ms (+ 0.28%)5,485ms5,539ms
Req 3 - references365ms (± 1.62%)370ms (± 1.03%)+5ms (+ 1.37%)365ms373ms
Req 4 - navto281ms (± 1.12%)281ms (± 1.05%)+1ms (+ 0.30%)278ms285ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo72ms (± 9.45%)67ms (± 2.57%)🟩-5ms (- 6.96%)65ms70ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,714ms (± 1.16%)2,731ms (± 0.95%)+16ms (+ 0.60%)2,701ms2,764ms
Req 2 - geterr4,051ms (± 0.45%)4,054ms (± 0.44%)+2ms (+ 0.06%)4,025ms4,076ms
Req 3 - references367ms (± 0.56%)370ms (± 0.57%)+3ms (+ 0.73%)367ms373ms
Req 4 - navto294ms (± 0.66%)294ms (± 0.35%)-0ms (- 0.06%)292ms295ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo67ms (± 0.77%)66ms (± 0.78%)-0ms (- 0.50%)66ms67ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,490ms (± 0.59%)3,485ms (± 0.75%)-5ms (- 0.14%)3,457ms3,529ms
Req 2 - geterr1,405ms (± 0.75%)1,403ms (± 0.96%)-2ms (- 0.17%)1,390ms1,428ms
Req 3 - references106ms (± 1.56%)106ms (± 1.29%)+0ms (+ 0.16%)104ms107ms
Req 4 - navto355ms (± 0.50%)356ms (± 0.46%)+1ms (+ 0.38%)355ms359ms
Req 5 - completionInfo count3,171 (± 0.00%)3,171 (± 0.00%)0 ( 0.00%)3,1713,171
Req 5 - completionInfo466ms (± 1.22%)466ms (± 0.81%)-1ms (- 0.14%)461ms471ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,785ms (± 0.51%)2,791ms (± 0.41%)+6ms (+ 0.22%)2,775ms2,806ms
Req 2 - geterr5,891ms (± 0.65%)5,910ms (± 0.64%)+19ms (+ 0.32%)5,860ms5,954ms
Req 3 - references379ms (± 2.10%)380ms (± 1.00%)+0ms (+ 0.04%)376ms386ms
Req 4 - navto279ms (± 0.67%)280ms (± 1.32%)+2ms (+ 0.60%)275ms286ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo74ms (± 7.16%)75ms (±10.03%)+2ms (+ 2.04%)70ms90ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,926ms (± 0.17%)2,932ms (± 0.44%)+6ms (+ 0.19%)2,918ms2,953ms
Req 2 - geterr4,385ms (± 0.51%)4,392ms (± 0.47%)+7ms (+ 0.17%)4,365ms4,423ms
Req 3 - references381ms (± 0.73%)384ms (± 0.86%)+3ms (+ 0.83%)379ms388ms
Req 4 - navto288ms (± 0.49%)289ms (± 0.51%)+1ms (+ 0.41%)288ms292ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo72ms (± 0.77%)72ms (± 1.14%)+0ms (+ 0.23%)71ms73ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,634ms (± 0.42%)3,629ms (± 0.23%)-6ms (- 0.16%)3,618ms3,638ms
Req 2 - geterr1,561ms (± 1.46%)1,551ms (± 0.78%)-11ms (- 0.68%)1,538ms1,570ms
Req 3 - references111ms (± 1.35%)112ms (± 1.35%)+0ms (+ 0.30%)109ms113ms
Req 4 - navto332ms (± 0.35%)341ms (± 0.96%)+10ms (+ 2.86%)338ms347ms
Req 5 - completionInfo count3,171 (± 0.00%)3,171 (± 0.00%)0 ( 0.00%)3,1713,171
Req 5 - completionInfo480ms (± 0.77%)478ms (± 0.81%)-2ms (- 0.35%)473ms485ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,897ms (± 0.23%)2,901ms (± 0.62%)+4ms (+ 0.12%)2,879ms2,934ms
Req 2 - geterr6,254ms (± 0.98%)6,299ms (± 1.11%)+45ms (+ 0.72%)6,229ms6,404ms
Req 3 - references391ms (± 0.38%)391ms (± 0.77%)-0ms (- 0.04%)386ms395ms
Req 4 - navto280ms (± 0.62%)284ms (± 1.36%)+4ms (+ 1.25%)279ms289ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo85ms (±11.56%)88ms (± 6.99%)+3ms (+ 3.33%)79ms93ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,063ms (± 0.21%)3,081ms (± 0.81%)+18ms (+ 0.59%)3,063ms3,131ms
Req 2 - geterr4,685ms (± 0.39%)4,687ms (± 0.45%)+2ms (+ 0.04%)4,657ms4,712ms
Req 3 - references413ms (± 1.06%)410ms (± 1.18%)-4ms (- 0.93%)404ms416ms
Req 4 - navto295ms (± 0.70%)297ms (± 0.50%)+2ms (+ 0.79%)295ms299ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo86ms (± 4.18%)90ms (± 4.99%)+4ms (+ 4.05%)88ms99ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,959ms (± 0.48%)3,965ms (± 0.44%)+6ms (+ 0.14%)3,935ms3,986ms
Req 2 - geterr1,517ms (± 1.70%)1,523ms (± 1.73%)+6ms (+ 0.37%)1,491ms1,558ms
Req 3 - references135ms (± 1.79%)131ms (± 2.83%)🟩-5ms (- 3.33%)127ms137ms
Req 4 - navto372ms (± 1.05%)374ms (± 0.73%)+2ms (+ 0.63%)370ms377ms
Req 5 - completionInfo count3,171 (± 0.00%)3,171 (± 0.00%)0 ( 0.00%)3,1713,171
Req 5 - completionInfo506ms (± 1.03%)497ms (± 2.79%)-9ms (- 1.81%)484ms522ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

Startup

Comparison Report - main..52382
Metricmain52382DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time141.74ms (± 0.21%)142.43ms (± 0.19%)+0.69ms (+ 0.49%)141.76ms146.30ms
tsserver-startup - node (v16.17.1, x64)
Execution time225.11ms (± 0.14%)227.03ms (± 0.17%)+1.92ms (+ 0.85%)225.98ms231.60ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time227.56ms (± 0.16%)229.37ms (± 0.22%)+1.81ms (+ 0.80%)228.22ms236.41ms
typescript-startup - node (v16.17.1, x64)
Execution time208.64ms (± 0.19%)210.16ms (± 0.18%)+1.52ms (+ 0.73%)209.15ms214.73ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..52382
Metricmain52382DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used359,659k (± 0.01%)359,828k (± 0.02%)+170k (+ 0.05%)359,728k359,896k
Parse Time3.93s (± 0.79%)3.96s (± 0.38%)+0.03s (+ 0.72%)3.94s3.98s
Bind Time1.17s (± 0.44%)1.17s (± 0.47%)+0.00s (+ 0.14%)1.17s1.18s
Check Time8.86s (± 0.35%)8.62s (± 0.47%)-0.24s (- 2.69%)8.56s8.67s
Emit Time7.62s (± 0.84%)7.63s (± 0.31%)+0.01s (+ 0.13%)7.60s7.65s
Total Time21.57s (± 0.49%)21.38s (± 0.21%)-0.20s (- 0.92%)21.32s21.42s
Compiler-Unions - node (v18.10.0, x64)
Memory used193,506k (± 1.17%)192,499k (± 0.08%)-1,007k (- 0.52%)192,298k192,631k
Parse Time1.63s (± 1.81%)1.63s (± 1.79%)+0.01s (+ 0.31%)1.59s1.66s
Bind Time0.79s (± 0.65%)0.79s (± 0.69%)+0.00s (+ 0.21%)0.79s0.80s
Check Time9.66s (± 0.53%)9.65s (± 0.66%)-0.00s (- 0.02%)9.60s9.75s
Emit Time2.80s (± 1.55%)2.89s (± 5.19%)+0.09s (+ 3.21%)2.78s3.09s
Total Time14.88s (± 0.48%)14.97s (± 0.78%)+0.10s (+ 0.64%)14.86s15.14s
Monaco - node (v18.10.0, x64)
Memory used343,954k (± 0.01%)343,971k (± 0.01%)+17k (+ 0.00%)343,931k344,033k
Parse Time2.95s (± 0.55%)2.94s (± 1.43%)-0.01s (- 0.23%)2.87s2.98s
Bind Time1.04s (± 1.17%)1.04s (± 0.79%)0.00s ( 0.00%)1.03s1.05s
Check Time7.30s (± 0.46%)7.06s (± 0.44%)🟩-0.24s (- 3.27%)7.01s7.09s
Emit Time4.36s (± 0.65%)4.32s (± 0.69%)-0.04s (- 0.96%)4.29s4.37s
Total Time15.64s (± 0.42%)15.36s (± 0.55%)-0.28s (- 1.80%)15.21s15.43s
TFS - node (v18.10.0, x64)
Memory used300,338k (± 0.01%)300,386k (± 0.00%)+47k (+ 0.02%)300,378k300,394k
Parse Time2.26s (± 1.30%)2.27s (± 2.11%)+0.02s (+ 0.74%)2.21s2.34s
Bind Time1.17s (± 0.47%)1.17s (± 0.64%)+0.01s (+ 0.57%)1.16s1.18s
Check Time6.89s (± 0.52%)6.55s (± 0.51%)🟩-0.35s (- 5.05%)6.50s6.60s
Emit Time3.93s (± 0.84%)3.92s (± 1.22%)-0.01s (- 0.25%)3.87s3.99s
Total Time14.24s (± 0.50%)13.91s (± 0.64%)-0.34s (- 2.38%)13.81s14.02s
material-ui - node (v18.10.0, x64)
Memory used476,775k (± 0.02%)476,730k (± 0.00%)-45k (- 0.01%)476,701k476,755k
Parse Time3.57s (± 0.46%)3.54s (± 0.92%)-0.03s (- 0.89%)3.49s3.58s
Bind Time0.96s (± 0.57%)0.97s (± 0.78%)+0.00s (+ 0.35%)0.96s0.98s
Check Time17.14s (± 1.11%)17.09s (± 0.31%)-0.05s (- 0.30%)17.02s17.15s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time21.68s (± 0.84%)21.60s (± 0.21%)-0.08s (- 0.38%)21.53s21.66s
xstate - node (v18.10.0, x64)
Memory used548,713k (± 0.02%)548,646k (± 0.04%)-68k (- 0.01%)548,452k548,994k
Parse Time4.58s (± 0.56%)4.55s (± 0.50%)-0.03s (- 0.62%)4.51s4.57s
Bind Time1.71s (± 0.68%)1.71s (± 1.03%)-0.01s (- 0.29%)1.69s1.74s
Check Time2.73s (± 0.46%)2.72s (± 1.18%)-0.01s (- 0.18%)2.68s2.77s
Emit Time0.08s (± 4.99%)0.08s (± 6.19%)+0.00s (+ 2.04%)0.08s0.09s
Total Time9.11s (± 0.37%)9.07s (± 0.29%)-0.04s (- 0.40%)9.02s9.09s
Angular - node (v16.17.1, x64)
Memory used359,034k (± 0.01%)359,187k (± 0.01%)+153k (+ 0.04%)359,156k359,232k
Parse Time4.18s (± 0.29%)4.18s (± 0.34%)+0.00s (+ 0.08%)4.16s4.20s
Bind Time1.22s (± 0.62%)1.22s (± 0.52%)-0.00s (- 0.14%)1.21s1.23s
Check Time9.55s (± 0.37%)9.37s (± 0.39%)-0.18s (- 1.89%)9.32s9.41s
Emit Time8.10s (± 0.64%)8.07s (± 0.68%)-0.02s (- 0.27%)7.99s8.15s
Total Time23.04s (± 0.35%)22.84s (± 0.38%)-0.20s (- 0.86%)22.70s22.96s
Compiler-Unions - node (v16.17.1, x64)
Memory used194,229k (± 0.03%)194,871k (± 0.68%)+642k (+ 0.33%)194,276k197,570k
Parse Time1.80s (± 0.45%)1.80s (± 0.45%)+0.01s (+ 0.37%)1.79s1.81s
Bind Time0.85s (± 0.65%)0.85s (± 0.61%)+0.00s (+ 0.20%)0.84s0.85s
Check Time10.35s (± 0.36%)10.37s (± 0.17%)+0.02s (+ 0.21%)10.34s10.39s
Emit Time3.04s (± 0.79%)3.05s (± 0.74%)+0.01s (+ 0.44%)3.02s3.08s
Total Time16.03s (± 0.40%)16.07s (± 0.08%)+0.04s (+ 0.26%)16.06s16.09s
Monaco - node (v16.17.1, x64)
Memory used343,223k (± 0.01%)343,261k (± 0.01%)+38k (+ 0.01%)343,230k343,291k
Parse Time3.16s (± 0.94%)3.16s (± 0.95%)-0.00s (- 0.11%)3.11s3.20s
Bind Time1.11s (± 0.47%)1.11s (± 0.93%)0.00s ( 0.00%)1.09s1.12s
Check Time7.89s (± 0.33%)7.71s (± 0.38%)-0.19s (- 2.34%)7.66s7.74s
Emit Time4.56s (± 0.33%)4.51s (± 0.52%)-0.04s (- 0.95%)4.48s4.54s
Total Time16.72s (± 0.13%)16.49s (± 0.33%)-0.23s (- 1.39%)16.40s16.55s
TFS - node (v16.17.1, x64)
Memory used299,690k (± 0.00%)299,772k (± 0.01%)+82k (+ 0.03%)299,755k299,794k
Parse Time2.45s (± 0.82%)2.49s (± 1.72%)+0.04s (+ 1.50%)2.44s2.54s
Bind Time1.25s (± 0.44%)1.25s (± 0.78%)-0.00s (- 0.27%)1.24s1.26s
Check Time7.50s (± 0.28%)7.20s (± 0.27%)🟩-0.30s (- 3.96%)7.17s7.22s
Emit Time4.24s (± 0.68%)4.22s (± 0.51%)-0.02s (- 0.43%)4.19s4.25s
Total Time15.44s (± 0.26%)15.16s (± 0.25%)-0.28s (- 1.82%)15.11s15.22s
material-ui - node (v16.17.1, x64)
Memory used476,074k (± 0.01%)476,039k (± 0.01%)-35k (- 0.01%)475,989k476,170k
Parse Time3.72s (± 0.33%)3.72s (± 0.24%)+0.00s (+ 0.13%)3.71s3.73s
Bind Time1.02s (± 0.51%)1.02s (± 0.40%)+0.00s (+ 0.49%)1.02s1.03s
Check Time18.12s (± 0.75%)18.13s (± 0.51%)+0.00s (+ 0.02%)18.06s18.28s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.86s (± 0.62%)22.87s (± 0.44%)+0.01s (+ 0.04%)22.79s23.03s
xstate - node (v16.17.1, x64)
Memory used546,268k (± 0.02%)546,281k (± 0.02%)+12k (+ 0.00%)546,180k546,443k
Parse Time4.76s (± 0.37%)4.74s (± 0.17%)-0.01s (- 0.28%)4.73s4.75s
Bind Time1.85s (± 0.34%)1.85s (± 0.22%)-0.00s (- 0.09%)1.84s1.85s
Check Time2.96s (± 0.66%)2.97s (± 0.30%)+0.01s (+ 0.45%)2.96s2.98s
Emit Time0.09s (± 5.53%)0.09s (± 0.00%)🟩-0.00s (- 3.57%)0.09s0.09s
Total Time9.66s (± 0.33%)9.65s (± 0.16%)-0.01s (- 0.10%)9.62s9.66s
Angular - node (v14.15.1, x64)
Memory used352,673k (± 0.01%)352,825k (± 0.01%)+153k (+ 0.04%)352,792k352,868k
Parse Time4.23s (± 0.49%)4.22s (± 0.38%)-0.01s (- 0.28%)4.20s4.24s
Bind Time1.28s (± 0.49%)1.29s (± 0.43%)+0.01s (+ 0.39%)1.28s1.29s
Check Time9.83s (± 0.33%)9.65s (± 0.61%)-0.18s (- 1.88%)9.60s9.76s
Emit Time8.35s (± 0.28%)8.37s (± 0.75%)+0.01s (+ 0.18%)8.30s8.46s
Total Time23.71s (± 0.14%)23.52s (± 0.48%)-0.19s (- 0.78%)23.42s23.71s
Compiler-Unions - node (v14.15.1, x64)
Memory used189,732k (± 0.67%)189,778k (± 0.73%)+46k (+ 0.02%)189,044k192,591k
Parse Time1.84s (± 0.64%)1.84s (± 0.41%)0.00s ( 0.00%)1.83s1.85s
Bind Time0.85s (± 0.64%)0.86s (± 0.00%)+0.01s (+ 0.58%)0.86s0.86s
Check Time10.42s (± 0.38%)10.39s (± 0.28%)-0.03s (- 0.27%)10.36s10.44s
Emit Time3.34s (± 4.90%)3.32s (± 5.50%)-0.01s (- 0.45%)3.15s3.54s
Total Time16.45s (± 0.95%)16.41s (± 1.04%)-0.04s (- 0.23%)16.20s16.60s
Monaco - node (v14.15.1, x64)
Memory used337,999k (± 0.00%)338,033k (± 0.00%)+34k (+ 0.01%)338,019k338,048k
Parse Time3.21s (± 0.60%)3.24s (± 0.81%)+0.03s (+ 0.83%)3.21s3.28s
Bind Time1.11s (± 0.50%)1.12s (± 0.92%)+0.01s (+ 1.06%)1.11s1.13s
Check Time8.26s (± 0.36%)8.03s (± 0.58%)-0.22s (- 2.67%)7.99s8.12s
Emit Time4.78s (± 0.59%)4.75s (± 0.70%)-0.03s (- 0.56%)4.71s4.81s
Total Time17.35s (± 0.25%)17.14s (± 0.40%)-0.21s (- 1.21%)17.07s17.27s
TFS - node (v14.15.1, x64)
Memory used294,507k (± 0.00%)294,591k (± 0.01%)+84k (+ 0.03%)294,563k294,621k
Parse Time2.75s (± 0.70%)2.75s (± 0.51%)-0.00s (- 0.06%)2.73s2.77s
Bind Time1.11s (± 0.99%)1.11s (± 0.89%)-0.00s (- 0.15%)1.09s1.12s
Check Time7.80s (± 0.25%)7.51s (± 0.37%)🟩-0.29s (- 3.72%)7.48s7.56s
Emit Time4.62s (± 0.37%)4.65s (± 0.57%)+0.03s (+ 0.65%)4.61s4.68s
Total Time16.28s (± 0.18%)16.02s (± 0.29%)-0.27s (- 1.64%)15.96s16.09s
material-ui - node (v14.15.1, x64)
Memory used471,508k (± 0.00%)471,546k (± 0.00%)+38k (+ 0.01%)471,527k471,575k
Parse Time3.92s (± 0.28%)3.91s (± 0.44%)-0.01s (- 0.30%)3.89s3.93s
Bind Time1.05s (± 0.49%)1.04s (± 0.80%)-0.00s (- 0.16%)1.03s1.05s
Check Time19.00s (± 0.54%)19.00s (± 0.26%)+0.00s (+ 0.02%)18.93s19.07s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time23.97s (± 0.40%)23.96s (± 0.18%)-0.01s (- 0.03%)23.91s24.01s
xstate - node (v14.15.1, x64)
Memory used534,331k (± 0.01%)534,451k (± 0.01%)+120k (+ 0.02%)534,378k534,496k
Parse Time5.14s (± 0.83%)5.16s (± 0.80%)+0.01s (+ 0.29%)5.11s5.21s
Bind Time1.71s (± 0.64%)1.71s (± 1.13%)-0.00s (- 0.10%)1.69s1.74s
Check Time3.09s (± 0.52%)3.08s (± 0.69%)-0.01s (- 0.32%)3.06s3.11s
Emit Time0.10s (± 0.00%)0.10s (± 0.00%)0.00s ( 0.00%)0.10s0.10s
Total Time10.04s (± 0.49%)10.04s (± 0.51%)+0.00s (+ 0.03%)9.96s10.11s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

TSServer

Comparison Report - main..52382
Metricmain52382DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,500ms (± 1.25%)2,502ms (± 2.02%)+2ms (+ 0.07%)2,462ms2,588ms
Req 2 - geterr5,502ms (± 0.46%)5,519ms (± 0.57%)+17ms (+ 0.32%)5,475ms5,562ms
Req 3 - references365ms (± 1.62%)366ms (± 0.92%)+2ms (+ 0.41%)364ms373ms
Req 4 - navto281ms (± 1.12%)284ms (± 0.14%)+4ms (+ 1.31%)284ms285ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo72ms (± 9.45%)67ms (± 2.62%)🟩-5ms (- 7.19%)65ms70ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,714ms (± 1.16%)2,727ms (± 1.25%)+13ms (+ 0.48%)2,691ms2,774ms
Req 2 - geterr4,051ms (± 0.45%)4,063ms (± 0.28%)+12ms (+ 0.29%)4,053ms4,078ms
Req 3 - references367ms (± 0.56%)369ms (± 0.45%)+2ms (+ 0.45%)367ms371ms
Req 4 - navto294ms (± 0.66%)296ms (± 0.74%)+2ms (+ 0.74%)293ms299ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo67ms (± 0.77%)80ms (± 5.60%)+14ms (+20.50%)73ms85ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,490ms (± 0.59%)3,498ms (± 0.77%)+9ms (+ 0.24%)3,473ms3,541ms
Req 2 - geterr1,405ms (± 0.75%)1,418ms (± 0.50%)+13ms (+ 0.90%)1,408ms1,430ms
Req 3 - references106ms (± 1.56%)106ms (± 2.10%)+0ms (+ 0.32%)103ms108ms
Req 4 - navto355ms (± 0.50%)357ms (± 0.59%)+2ms (+ 0.56%)354ms360ms
Req 5 - completionInfo count3,171 (± 0.00%)3,171 (± 0.00%)0 ( 0.00%)3,1713,171
Req 5 - completionInfo466ms (± 1.22%)463ms (± 1.16%)-3ms (- 0.68%)453ms468ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,785ms (± 0.51%)2,783ms (± 0.34%)-2ms (- 0.08%)2,775ms2,795ms
Req 2 - geterr5,891ms (± 0.65%)5,875ms (± 0.48%)-16ms (- 0.27%)5,837ms5,906ms
Req 3 - references379ms (± 2.10%)376ms (± 1.54%)-3ms (- 0.79%)368ms383ms
Req 4 - navto279ms (± 0.67%)277ms (± 0.85%)-2ms (- 0.54%)274ms280ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo74ms (± 7.16%)75ms (± 8.78%)+2ms (+ 2.26%)69ms87ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,926ms (± 0.17%)2,939ms (± 0.85%)+13ms (+ 0.45%)2,908ms2,984ms
Req 2 - geterr4,385ms (± 0.51%)4,389ms (± 0.46%)+5ms (+ 0.11%)4,370ms4,422ms
Req 3 - references381ms (± 0.73%)381ms (± 0.51%)0ms ( 0.00%)378ms383ms
Req 4 - navto288ms (± 0.49%)288ms (± 0.34%)-0ms (- 0.06%)287ms289ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo72ms (± 0.77%)71ms (± 1.06%)-0ms (- 0.47%)70ms72ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,634ms (± 0.42%)3,631ms (± 0.17%)-4ms (- 0.10%)3,623ms3,639ms
Req 2 - geterr1,561ms (± 1.46%)1,553ms (± 0.96%)-8ms (- 0.53%)1,534ms1,578ms
Req 3 - references111ms (± 1.35%)111ms (± 1.05%)-1ms (- 0.45%)110ms113ms
Req 4 - navto332ms (± 0.35%)341ms (± 0.40%)+9ms (+ 2.61%)339ms342ms
Req 5 - completionInfo count3,171 (± 0.00%)3,171 (± 0.00%)0 ( 0.00%)3,1713,171
Req 5 - completionInfo480ms (± 0.77%)480ms (± 0.88%)-0ms (- 0.07%)475ms487ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,897ms (± 0.23%)2,898ms (± 0.42%)+0ms (+ 0.01%)2,879ms2,916ms
Req 2 - geterr6,254ms (± 0.98%)6,272ms (± 0.91%)+18ms (+ 0.28%)6,215ms6,371ms
Req 3 - references391ms (± 0.38%)392ms (± 1.03%)+0ms (+ 0.09%)387ms399ms
Req 4 - navto280ms (± 0.62%)282ms (± 1.34%)+1ms (+ 0.42%)279ms289ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo85ms (±11.56%)86ms (± 9.58%)+1ms (+ 1.18%)73ms93ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,063ms (± 0.21%)3,083ms (± 0.81%)+20ms (+ 0.65%)3,051ms3,119ms
Req 2 - geterr4,685ms (± 0.39%)4,678ms (± 0.28%)-7ms (- 0.14%)4,662ms4,696ms
Req 3 - references413ms (± 1.06%)404ms (± 0.68%)-9ms (- 2.18%)402ms408ms
Req 4 - navto295ms (± 0.70%)294ms (± 0.53%)-1ms (- 0.17%)292ms295ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo86ms (± 4.18%)83ms (± 4.77%)🟩-4ms (- 4.44%)79ms88ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,959ms (± 0.48%)3,983ms (± 0.51%)+24ms (+ 0.60%)3,962ms4,018ms
Req 2 - geterr1,517ms (± 1.70%)1,526ms (± 1.25%)+9ms (+ 0.62%)1,507ms1,556ms
Req 3 - references135ms (± 1.79%)133ms (± 2.50%)-3ms (- 1.97%)128ms137ms
Req 4 - navto372ms (± 1.05%)375ms (± 0.56%)+3ms (+ 0.81%)371ms377ms
Req 5 - completionInfo count3,171 (± 0.00%)3,171 (± 0.00%)0 ( 0.00%)3,1713,171
Req 5 - completionInfo506ms (± 1.03%)512ms (± 1.84%)+7ms (+ 1.29%)502ms529ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

Startup

Comparison Report - main..52382
Metricmain52382DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time141.74ms (± 0.21%)141.91ms (± 0.19%)+0.18ms (+ 0.12%)141.17ms146.22ms
tsserver-startup - node (v16.17.1, x64)
Execution time225.11ms (± 0.14%)225.51ms (± 0.20%)+0.39ms (+ 0.17%)224.60ms232.99ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time227.56ms (± 0.16%)227.98ms (± 0.17%)+0.43ms (+ 0.19%)227.06ms234.04ms
typescript-startup - node (v16.17.1, x64)
Execution time208.64ms (± 0.19%)208.90ms (± 0.19%)+0.26ms (+ 0.13%)207.98ms215.98ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

Developer Information:

Download Benchmark

@jakebailey
Copy link
MemberAuthor

Yay! That looks like a few percent improvement ranging from 1-5% ish.

@jakebaileyjakebailey changed the title[experiment] Reuse PrintersReuse Printers with common optionsJan 24, 2023
@jakebaileyjakebailey marked this pull request as ready for reviewJanuary 24, 2023 06:09
@jakebailey
Copy link
MemberAuthor

I've rechecked the numbers from above; I can reproduce the 2% overall benefit on TFS:

Benchmark 1: main  Time (mean ± σ):     17.619 s ±  0.045 s    [User: 17.314 s, System: 0.279 s]  Range (min … max):   17.511 s … 17.702 s    20 runs   Warning: Ignoring non-zero exit code. Benchmark 2: 52382  Time (mean ± σ):     17.301 s ±  0.042 s    [User: 17.016 s, System: 0.259 s]  Range (min … max):   17.225 s … 17.402 s    20 runs   Warning: Ignoring non-zero exit code. Summary  '52382' ran    1.02 ± 0.00 times faster than 'main'

Which at least seems to indicate that the rest of the numbers are real.

But, I see no improvement when compiling our codebase, which to me indicates that this is probably just improving the performance of error messages. I think this comes down to the fact that our benchmarks are so old that none of them compile anymore. That isn't to say that improving that case isn't worthwhile, though.

@DanielRosenwasser
Copy link
Member

I mentioned this over chat - I am curious whether things like long completion lists of auto-imports benefit here. I don't know if our perf suite captures that sort of thing though.

@jakebailey
Copy link
MemberAuthor

I mentioned this over chat - I am curious whether things like long completion lists of auto-imports benefit here. I don't know if our perf suite captures that sort of thing though.

I don't know that it does; quick info and completions appear to usegetSymbolDisplayPartsDocumentationAndSymbolKind, which already uses an optimization like this (I'm going to update the PR to consolidate it).

@jakebailey
Copy link
MemberAuthor

After this PR, the only places we arbitrarily come up with printers is:

  • The completion snippet printer
  • A completion signature printer (used along side snippets for the "detail" field)
  • In textChanges'getNonformattedText

I think these are all places that should reuse printers, but they are tricky because they pass a lot more options in; all of the ones I've touched in this PR only pass 0-2 of them so they're easy to enumerate.

Comment on lines -733 to -736
if(!printer){
printer=createPrinter({removeComments:true});
}
returnprinter;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Here's the code which already reused the printer; that being said, it only cached it once for each symbol, so it could totally be that this is a big improvement. Will have to rerun the benchmarks.

@jakebailey
Copy link
MemberAuthor

Unfortunately the difference is that all of those other writers mentioned above also pass inPrintHandlers which can't be memoized. I'm a little confused though, as that appears to always bewriter which is always passed in as an argument instead.

@jakebailey
Copy link
MemberAuthor

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 25, 2023
edited
Loading

Heya@jakebailey, I've started to run the tarball bundle task on this PR at4102e95. You can monitor the buildhere.

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 25, 2023
edited
Loading

Hey@jakebailey, I've packed this intoan installable tgz. You can install it for testing by referencing it in yourpackage.json like so:

{    "devDependencies": {        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/143917/artifacts?artifactName=tgz&fileId=69B086734D27136ECC49E773E04D82909A0A11EF02E3E36F3631B427C63D71F602&fileName=/typescript-5.0.0-insiders.20230125.tgz"    }}

and then runningnpm install.


There is also a playgroundfor this build and annpm module you can use via"typescript": "npm:@typescript-deploys/pr-build@5.0.0-pr-52382-14".;

@jakebailey
Copy link
MemberAuthor

I'm not sure I'm going to keep this latest commit, but I want to try and see if it's worse in some way.

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 25, 2023
edited
Loading

Heya@jakebailey, I've started to run the perf test suite on this PR at28dfb91. You can monitor the buildhere.

Update:The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..52382
Metricmain52382DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used359,693k (± 0.01%)359,835k (± 0.02%)+142k (+ 0.04%)359,745k359,921k
Parse Time3.95s (± 0.94%)3.96s (± 0.38%)+0.01s (+ 0.25%)3.93s3.97s
Bind Time1.17s (± 0.35%)1.18s (± 0.47%)+0.00s (+ 0.28%)1.17s1.18s
Check Time8.85s (± 0.30%)8.64s (± 0.76%)-0.20s (- 2.26%)8.58s8.74s
Emit Time7.58s (± 0.39%)7.64s (± 0.65%)+0.06s (+ 0.75%)7.59s7.71s
Total Time21.55s (± 0.21%)21.42s (± 0.47%)-0.13s (- 0.62%)21.33s21.56s
Compiler-Unions - node (v18.10.0, x64)
Memory used194,467k (± 1.52%)194,471k (± 1.52%)+4k (+ 0.00%)192,507k198,310k
Parse Time1.64s (± 1.86%)1.62s (± 2.04%)-0.02s (- 1.42%)1.59s1.66s
Bind Time0.80s (± 0.69%)0.80s (± 1.02%)+0.00s (+ 0.21%)0.79s0.81s
Check Time9.68s (± 0.92%)9.69s (± 0.69%)+0.01s (+ 0.09%)9.59s9.78s
Emit Time2.79s (± 1.00%)2.85s (± 4.20%)+0.05s (+ 1.91%)2.79s3.09s
Total Time14.91s (± 0.65%)14.95s (± 0.68%)+0.04s (+ 0.29%)14.83s15.13s
Monaco - node (v18.10.0, x64)
Memory used343,978k (± 0.01%)344,010k (± 0.01%)+32k (+ 0.01%)343,947k344,065k
Parse Time2.96s (± 0.89%)2.95s (± 1.44%)-0.01s (- 0.45%)2.88s2.99s
Bind Time1.03s (± 1.17%)1.03s (± 1.46%)0.00s ( 0.00%)1.02s1.05s
Check Time7.29s (± 0.56%)7.03s (± 0.43%)🟩-0.26s (- 3.56%)7.00s7.08s
Emit Time4.35s (± 0.74%)4.33s (± 1.01%)-0.02s (- 0.38%)4.30s4.41s
Total Time15.63s (± 0.42%)15.35s (± 0.73%)-0.28s (- 1.81%)15.21s15.51s
TFS - node (v18.10.0, x64)
Memory used300,321k (± 0.00%)300,388k (± 0.01%)+67k (+ 0.02%)300,334k300,409k
Parse Time2.24s (± 1.24%)2.27s (± 1.19%)+0.03s (+ 1.49%)2.24s2.30s
Bind Time1.17s (± 0.88%)1.17s (± 0.64%)+0.00s (+ 0.14%)1.16s1.18s
Check Time6.90s (± 0.36%)6.55s (± 0.37%)🟩-0.34s (- 5.00%)6.51s6.57s
Emit Time3.93s (± 0.73%)3.90s (± 0.80%)-0.03s (- 0.76%)3.86s3.95s
Total Time14.24s (± 0.34%)13.90s (± 0.39%)-0.34s (- 2.39%)13.79s13.93s
material-ui - node (v18.10.0, x64)
Memory used476,721k (± 0.01%)476,717k (± 0.01%)-5k (- 0.00%)476,669k476,753k
Parse Time3.55s (± 0.53%)3.57s (± 0.60%)+0.02s (+ 0.61%)3.55s3.60s
Bind Time0.97s (± 0.78%)0.97s (± 0.53%)-0.00s (- 0.17%)0.96s0.97s
Check Time17.09s (± 0.28%)17.12s (± 0.46%)+0.03s (+ 0.17%)17.02s17.26s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time21.61s (± 0.29%)21.66s (± 0.43%)+0.05s (+ 0.21%)21.55s21.82s
xstate - node (v18.10.0, x64)
Memory used548,654k (± 0.01%)548,579k (± 0.02%)-75k (- 0.01%)548,449k548,712k
Parse Time4.56s (± 0.33%)4.56s (± 0.58%)+0.00s (+ 0.11%)4.51s4.58s
Bind Time1.71s (± 0.86%)1.71s (± 1.20%)+0.00s (+ 0.29%)1.68s1.73s
Check Time2.74s (± 0.75%)2.74s (± 0.72%)-0.01s (- 0.30%)2.71s2.76s
Emit Time0.08s (± 4.99%)0.09s (± 4.62%)+0.01s (+ 8.16%)0.08s0.09s
Total Time9.10s (± 0.18%)9.10s (± 0.31%)0.00s ( 0.00%)9.07s9.15s
Angular - node (v16.17.1, x64)
Memory used359,056k (± 0.01%)359,212k (± 0.01%)+156k (+ 0.04%)359,180k359,238k
Parse Time4.19s (± 0.44%)4.17s (± 0.39%)-0.01s (- 0.28%)4.16s4.20s
Bind Time1.22s (± 0.33%)1.22s (± 0.45%)+0.00s (+ 0.27%)1.22s1.23s
Check Time9.55s (± 0.18%)9.40s (± 0.16%)-0.14s (- 1.52%)9.39s9.43s
Emit Time8.08s (± 0.48%)8.05s (± 0.60%)-0.02s (- 0.29%)8.01s8.13s
Total Time23.04s (± 0.16%)22.86s (± 0.19%)-0.18s (- 0.80%)22.82s22.91s
Compiler-Unions - node (v16.17.1, x64)
Memory used194,251k (± 0.03%)194,233k (± 0.06%)-18k (- 0.01%)194,118k194,441k
Parse Time1.81s (± 0.45%)1.80s (± 0.35%)-0.01s (- 0.37%)1.79s1.81s
Bind Time0.84s (± 1.06%)0.85s (± 0.74%)+0.01s (+ 1.19%)0.84s0.86s
Check Time10.37s (± 0.36%)10.43s (± 0.80%)+0.06s (+ 0.59%)10.30s10.55s
Emit Time3.06s (± 0.77%)3.05s (± 1.07%)-0.01s (- 0.22%)3.01s3.09s
Total Time16.08s (± 0.19%)16.13s (± 0.54%)+0.05s (+ 0.34%)15.99s16.24s
Monaco - node (v16.17.1, x64)
Memory used343,217k (± 0.01%)343,255k (± 0.01%)+38k (+ 0.01%)343,229k343,283k
Parse Time3.14s (± 0.82%)3.17s (± 1.14%)+0.03s (+ 0.90%)3.12s3.22s
Bind Time1.11s (± 0.89%)1.11s (± 0.46%)+0.00s (+ 0.45%)1.11s1.12s
Check Time7.89s (± 0.25%)7.70s (± 0.33%)-0.19s (- 2.41%)7.67s7.73s
Emit Time4.57s (± 0.39%)4.52s (± 0.83%)-0.05s (- 1.02%)4.47s4.58s
Total Time16.70s (± 0.24%)16.50s (± 0.30%)-0.20s (- 1.19%)16.45s16.59s
TFS - node (v16.17.1, x64)
Memory used299,713k (± 0.01%)299,768k (± 0.01%)+55k (+ 0.02%)299,737k299,797k
Parse Time2.47s (± 1.40%)2.48s (± 1.26%)+0.01s (+ 0.54%)2.44s2.52s
Bind Time1.25s (± 0.33%)1.26s (± 0.50%)+0.01s (+ 0.67%)1.25s1.27s
Check Time7.53s (± 0.50%)7.23s (± 0.22%)🟩-0.30s (- 4.01%)7.21s7.25s
Emit Time4.24s (± 0.79%)4.24s (± 0.75%)-0.00s (- 0.04%)4.20s4.29s
Total Time15.49s (± 0.38%)15.21s (± 0.42%)-0.28s (- 1.83%)15.10s15.30s
material-ui - node (v16.17.1, x64)
Memory used476,133k (± 0.02%)476,020k (± 0.01%)-113k (- 0.02%)475,973k476,114k
Parse Time3.72s (± 0.40%)3.72s (± 0.36%)+0.00s (+ 0.04%)3.71s3.74s
Bind Time1.02s (± 0.00%)1.02s (± 0.51%)-0.00s (- 0.33%)1.01s1.02s
Check Time18.05s (± 0.13%)18.09s (± 0.27%)+0.04s (+ 0.23%)18.02s18.14s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.78s (± 0.14%)22.82s (± 0.20%)+0.05s (+ 0.20%)22.74s22.87s
xstate - node (v16.17.1, x64)
Memory used546,280k (± 0.03%)546,223k (± 0.02%)-57k (- 0.01%)546,143k546,350k
Parse Time4.76s (± 0.57%)4.75s (± 0.56%)-0.00s (- 0.07%)4.72s4.80s
Bind Time1.81s (± 4.15%)1.81s (± 3.86%)-0.00s (- 0.09%)1.67s1.85s
Check Time2.98s (± 2.58%)2.99s (± 2.61%)+0.02s (+ 0.50%)2.94s3.15s
Emit Time0.09s (± 4.45%)0.09s (± 5.53%)+0.00s (+ 1.82%)0.09s0.10s
Total Time9.65s (± 0.47%)9.65s (± 0.34%)+0.00s (+ 0.03%)9.62s9.71s
Angular - node (v14.15.1, x64)
Memory used352,668k (± 0.01%)352,845k (± 0.01%)+177k (+ 0.05%)352,817k352,868k
Parse Time4.23s (± 0.35%)4.23s (± 0.51%)-0.00s (- 0.12%)4.19s4.25s
Bind Time1.28s (± 0.40%)1.28s (± 0.49%)-0.00s (- 0.26%)1.27s1.29s
Check Time9.84s (± 0.23%)9.68s (± 0.66%)-0.16s (- 1.64%)9.61s9.78s
Emit Time8.38s (± 0.39%)8.37s (± 0.87%)-0.01s (- 0.08%)8.29s8.49s
Total Time23.73s (± 0.15%)23.55s (± 0.43%)-0.18s (- 0.75%)23.42s23.69s
Compiler-Unions - node (v14.15.1, x64)
Memory used189,268k (± 0.06%)189,779k (± 0.73%)+511k (+ 0.27%)189,079k192,598k
Parse Time1.85s (± 0.95%)1.84s (± 0.66%)-0.00s (- 0.09%)1.83s1.86s
Bind Time0.86s (± 0.00%)0.86s (± 0.47%)+0.00s (+ 0.19%)0.86s0.87s
Check Time10.41s (± 0.33%)10.42s (± 0.77%)+0.01s (+ 0.10%)10.28s10.50s
Emit Time3.21s (± 4.13%)3.32s (± 5.41%)+0.11s (+ 3.48%)3.15s3.52s
Total Time16.33s (± 0.91%)16.45s (± 1.09%)+0.13s (+ 0.77%)16.24s16.73s
Monaco - node (v14.15.1, x64)
Memory used337,987k (± 0.01%)338,047k (± 0.00%)+60k (+ 0.02%)338,026k338,062k
Parse Time3.22s (± 1.28%)3.25s (± 0.77%)+0.03s (+ 0.93%)3.22s3.29s
Bind Time1.12s (± 0.75%)1.11s (± 0.37%)-0.01s (- 0.60%)1.10s1.11s
Check Time8.25s (± 0.57%)8.04s (± 0.54%)-0.20s (- 2.47%)7.98s8.10s
Emit Time4.81s (± 0.43%)4.78s (± 0.89%)-0.03s (- 0.59%)4.72s4.83s
Total Time17.39s (± 0.20%)17.18s (± 0.37%)-0.21s (- 1.19%)17.13s17.30s
TFS - node (v14.15.1, x64)
Memory used294,512k (± 0.01%)294,577k (± 0.01%)+65k (+ 0.02%)294,550k294,592k
Parse Time2.74s (± 0.88%)2.75s (± 0.61%)+0.01s (+ 0.18%)2.72s2.77s
Bind Time1.11s (± 0.00%)1.11s (± 0.68%)-0.00s (- 0.15%)1.10s1.12s
Check Time7.81s (± 0.50%)7.54s (± 0.70%)🟩-0.27s (- 3.52%)7.47s7.63s
Emit Time4.65s (± 0.52%)4.62s (± 0.84%)-0.04s (- 0.75%)4.58s4.67s
Total Time16.32s (± 0.28%)16.02s (± 0.44%)-0.30s (- 1.87%)15.92s16.10s
material-ui - node (v14.15.1, x64)
Memory used471,503k (± 0.00%)471,544k (± 0.00%)+42k (+ 0.01%)471,518k471,569k
Parse Time3.93s (± 0.44%)3.94s (± 0.67%)+0.01s (+ 0.25%)3.90s3.97s
Bind Time1.05s (± 0.99%)1.05s (± 0.78%)0.00s ( 0.00%)1.04s1.06s
Check Time19.05s (± 0.55%)18.99s (± 0.36%)-0.06s (- 0.31%)18.91s19.09s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time24.03s (± 0.54%)23.98s (± 0.36%)-0.05s (- 0.21%)23.87s24.10s
xstate - node (v14.15.1, x64)
Memory used534,330k (± 0.01%)534,486k (± 0.01%)+156k (+ 0.03%)534,410k534,535k
Parse Time5.14s (± 0.78%)5.16s (± 0.92%)+0.02s (+ 0.36%)5.09s5.22s
Bind Time1.72s (± 0.86%)1.72s (± 0.77%)+0.00s (+ 0.19%)1.70s1.74s
Check Time3.08s (± 0.67%)3.10s (± 0.67%)+0.01s (+ 0.43%)3.07s3.12s
Emit Time0.10s (± 0.00%)0.10s (± 0.00%)0.00s ( 0.00%)0.10s0.10s
Total Time10.04s (± 0.57%)10.08s (± 0.53%)+0.04s (+ 0.35%)10.02s10.17s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

TSServer

Comparison Report - main..52382
Metricmain52382DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,533ms (± 1.54%)2,496ms (± 1.83%)-38ms (- 1.48%)2,456ms2,582ms
Req 2 - geterr5,510ms (± 0.33%)5,524ms (± 0.44%)+14ms (+ 0.25%)5,501ms5,554ms
Req 3 - references364ms (± 1.48%)368ms (± 1.20%)+4ms (+ 0.96%)364ms376ms
Req 4 - navto283ms (± 0.99%)285ms (± 0.36%)+2ms (+ 0.77%)283ms286ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo68ms (± 4.41%)67ms (± 3.52%)-1ms (- 1.97%)65ms71ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,735ms (± 1.49%)2,724ms (± 1.55%)-11ms (- 0.41%)2,691ms2,786ms
Req 2 - geterr4,043ms (± 0.47%)4,060ms (± 0.72%)+18ms (+ 0.44%)4,020ms4,092ms
Req 3 - references367ms (± 0.36%)367ms (± 0.44%)-1ms (- 0.14%)365ms369ms
Req 4 - navto293ms (± 0.63%)297ms (± 0.55%)+5ms (+ 1.54%)295ms299ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo66ms (± 0.62%)81ms (± 2.01%)+15ms (+22.92%)78ms82ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,489ms (± 0.77%)3,499ms (± 0.27%)+10ms (+ 0.28%)3,487ms3,509ms
Req 2 - geterr1,404ms (± 1.50%)1,402ms (± 0.68%)-2ms (- 0.13%)1,388ms1,412ms
Req 3 - references106ms (± 0.97%)105ms (± 1.44%)-2ms (- 1.57%)103ms106ms
Req 4 - navto355ms (± 0.68%)357ms (± 1.59%)+2ms (+ 0.47%)353ms368ms
Req 5 - completionInfo count3,171 (± 0.00%)3,171 (± 0.00%)0 ( 0.00%)3,1713,171
Req 5 - completionInfo467ms (± 1.27%)469ms (± 0.93%)+3ms (+ 0.54%)465ms475ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,786ms (± 0.40%)2,797ms (± 0.13%)+11ms (+ 0.39%)2,793ms2,802ms
Req 2 - geterr5,886ms (± 0.36%)5,915ms (± 1.57%)+29ms (+ 0.49%)5,838ms6,090ms
Req 3 - references379ms (± 1.03%)375ms (± 1.09%)-4ms (- 1.14%)370ms381ms
Req 4 - navto279ms (± 1.66%)277ms (± 0.91%)-2ms (- 0.54%)273ms280ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo80ms (± 9.04%)75ms (± 7.13%)🟩-5ms (- 6.68%)68ms82ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,927ms (± 0.37%)2,931ms (± 0.79%)+4ms (+ 0.13%)2,914ms2,975ms
Req 2 - geterr4,391ms (± 0.61%)4,404ms (± 0.51%)+13ms (+ 0.30%)4,364ms4,423ms
Req 3 - references383ms (± 0.71%)381ms (± 0.87%)-3ms (- 0.65%)376ms384ms
Req 4 - navto287ms (± 0.87%)287ms (± 0.57%)-1ms (- 0.29%)284ms289ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo72ms (± 1.14%)72ms (± 1.62%)+1ms (+ 0.70%)71ms74ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,642ms (± 0.45%)3,630ms (± 0.44%)-13ms (- 0.34%)3,610ms3,645ms
Req 2 - geterr1,546ms (± 0.96%)1,541ms (± 0.78%)-5ms (- 0.30%)1,521ms1,558ms
Req 3 - references112ms (± 1.43%)111ms (± 2.30%)-1ms (- 0.60%)109ms115ms
Req 4 - navto333ms (± 0.49%)340ms (± 0.76%)+7ms (+ 2.05%)337ms344ms
Req 5 - completionInfo count3,171 (± 0.00%)3,171 (± 0.00%)0 ( 0.00%)3,1713,171
Req 5 - completionInfo478ms (± 0.85%)480ms (± 0.56%)+2ms (+ 0.38%)477ms484ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,900ms (± 0.55%)2,906ms (± 0.58%)+6ms (+ 0.21%)2,889ms2,931ms
Req 2 - geterr6,271ms (± 0.67%)6,276ms (± 0.90%)+5ms (+ 0.08%)6,181ms6,338ms
Req 3 - references387ms (± 0.45%)391ms (± 0.89%)+4ms (+ 0.90%)387ms396ms
Req 4 - navto284ms (± 1.45%)282ms (± 2.18%)-2ms (- 0.65%)277ms294ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo87ms (± 7.36%)89ms (± 6.09%)+2ms (+ 2.30%)79ms93ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,063ms (± 0.28%)3,069ms (± 0.75%)+7ms (+ 0.21%)3,052ms3,112ms
Req 2 - geterr4,669ms (± 0.28%)4,707ms (± 0.51%)+39ms (+ 0.82%)4,669ms4,731ms
Req 3 - references413ms (± 1.46%)407ms (± 0.96%)-6ms (- 1.37%)402ms411ms
Req 4 - navto297ms (± 0.45%)296ms (± 0.50%)-1ms (- 0.34%)294ms298ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo88ms (± 0.85%)81ms (± 3.52%)🟩-7ms (- 7.94%)80ms87ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,962ms (± 0.53%)3,965ms (± 0.48%)+3ms (+ 0.06%)3,944ms3,998ms
Req 2 - geterr1,518ms (± 1.29%)1,524ms (± 1.91%)+6ms (+ 0.36%)1,487ms1,559ms
Req 3 - references133ms (± 3.36%)129ms (± 2.79%)-3ms (- 2.39%)124ms135ms
Req 4 - navto374ms (± 0.84%)375ms (± 0.53%)+1ms (+ 0.31%)372ms377ms
Req 5 - completionInfo count3,171 (± 0.00%)3,171 (± 0.00%)0 ( 0.00%)3,1713,171
Req 5 - completionInfo504ms (± 1.39%)494ms (± 2.07%)-10ms (- 1.92%)485ms507ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

Startup

Comparison Report - main..52382
Metricmain52382DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time141.78ms (± 0.17%)141.94ms (± 0.17%)+0.16ms (+ 0.11%)141.21ms146.04ms
tsserver-startup - node (v16.17.1, x64)
Execution time225.20ms (± 0.14%)225.64ms (± 0.20%)+0.44ms (+ 0.19%)224.60ms232.81ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time227.82ms (± 0.16%)228.67ms (± 0.31%)+0.85ms (+ 0.37%)227.10ms236.79ms
typescript-startup - node (v16.17.1, x64)
Execution time208.79ms (± 0.16%)209.32ms (± 0.23%)+0.53ms (+ 0.25%)208.25ms218.89ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

Developer Information:

Download Benchmark

@jakebailey
Copy link
MemberAuthor

Performance of this more scalable / fancier version appear to be the same; that's good and makes some sense given this is the same sort of thing we do for other caches in the checker.

I have a more invasive change which changes printer to allow you to pass inhandlers in the internal APIs which would fix the rest, but I'll try that on another experimental PR first.

Comment on lines 1354 to 1359
const key = keyBool(o.removeComments)
+ keyBool(o.neverAsciiEscape)
+ keyBool(o.omitTrailingSemicolon)
+ keyNum(o.module)
+ keyNum(o.target)
+ keyNum(o.newLine);
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Believe it or not, this is the fastest cache key of the variants I tried.

Copy link
Member

Choose a reason for hiding this comment

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

It's actually faster than using a simple native template string like

`${o.removeComments}|${o.neverAsciiEscape}|${o.omitTrailingSemicolon}|${o.module}|${o.target}|${o.newLine}`

? Feels odd.

Copy link
Member

@weswighamweswighamJan 25, 2023
edited
Loading

Choose a reason for hiding this comment

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

Oh, but, perhaps more relevant - we have agetKeyForCompilerOptions function already. It's used by thedocumentRegistry in the language service and in the module resolver. If there is actually a big difference in time spent making the key, maybe some changes to it would be warranted as well? I'd certainly prefer it if we reused the existing option-key-generating-mechanism if we could.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

So, two things:

  • Writing outkeyBool(...) + "|" + keyBool(...) + "|" + ... was just as fast as writing out${keyBool(...)}|${keyBool(...)}....
  • Moving the separators into the "keys" (i.e. how I didu,1,0,) instead of putting them the template wastwice as fast.

So, I opted for the variant which doesn't make the line go way way to the right as the number of parts increases.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

That being said it's still like millions of iterations per second so unlikely to matter; I was really sad to find that[..., ..., ...].join("|") was an order of magnitude slower than these methods.

I'll go take a look at that other function.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ah,getKeyForCompilerOptions is quite literally what I said was slow above; given the arbitrary nature of the big list of compiler keys, I'm not sure I could change that.

The checker itself does have a few internal caches which do the hardcoded thing you said (and I did first), hard to say if they'd really benefit.

I'm happy to make this whatever makes sense, I just knew for this one I had to combine like 6 things and the length was getting unwieldy (so I resorted to helpers and multiple lines).

Copy link
Member

Choose a reason for hiding this comment

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

All 2 existing usages ofgetKeyForCompilerOptions actually use a fixed list of keys - longer lists, to be sure, made by filtering the full list of options by a boolean flag set on the option, but still fixed lists. In module resolution, we actually use these keys quite a lot - if it's bad enough to matter here, I'd think it'd matter there, too.

Writing out keyBool(...) + "|" + keyBool(...) + "|" + ... was just as fast as writing out ${keyBool(...)}|${keyBool(...)}....

As for the simpler case, my focus on moreso why the coercion functions were needed at all, and a simple string concatenation wouldn't suffice. Since the order is fixed, it's not like you need to distringuish between strings andundefined ortrue orfalse or the like - is there a perf benefit to writingvalue === undefined ? "u," : value ? "1," : "0," over${value},?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ah, I see. I tested that one out and it was middling in performance.

https://jsbench.me/prldbzl6dj/2 is what I was using to test, but I also can just revert these last few commits and go back to the version which hardcodes the 4 most common ones.

Copy link
Member

@weswighamweswighamJan 25, 2023
edited
Loading

Choose a reason for hiding this comment

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

For your future cache key micro-optimizing endeavors: If string concatenation is the slow bit, seems like it's best to skip on strings almost entirely:

functionbitwise(o){return""+((o.removeComments ?1 :0)|(o.neverAsciiEscape ?2 :0)|(o.omitTrailingSemicolon ?4 :0)|(o.module<<4)// 0-199|(o.target<<12)// 0-100|(o.newLine<<20));// 0-1}

is ~5% faster than the string-based next best 😛 (assuming it's OK to treat undefined and false the same, which it might be, might not be in this case)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

That's a good idea (doesn't even have to be a string key either, so we could skip the ""+)

@jakebailey
Copy link
MemberAuthor

I've reverted this back to its approved state (for the beta); no fancy cache, just a shortlist of hardcoded predefined defaults.

@jakebailey
Copy link
MemberAuthor

@typescript-bot perf test this faster

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 25, 2023
edited
Loading

Heya@jakebailey, I've started to run the abridged perf test suite on this PR at708216a. You can monitor the buildhere.

Update:The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..52382

Metricmain52382DeltaBestWorst
Angular - node (v16.17.1, x64)
Memory used359,040k (± 0.01%)359,221k (± 0.01%)+181k (+ 0.05%)359,193k359,250k
Parse Time4.18s (± 0.29%)4.19s (± 0.39%)+0.00s (+ 0.00%)4.16s4.21s
Bind Time1.23s (± 0.51%)1.22s (± 0.84%)-0.01s (- 0.54%)1.21s1.24s
Check Time9.56s (± 0.33%)9.41s (± 0.23%)-0.15s (- 1.52%)9.39s9.45s
Emit Time8.09s (± 0.24%)8.06s (± 0.46%)-0.03s (- 0.35%)8.01s8.11s
Total Time23.05s (± 0.21%)22.88s (± 0.20%)-0.17s (- 0.73%)22.83s22.94s
Compiler-Unions - node (v16.17.1, x64)
Memory used194,254k (± 0.04%)194,732k (± 0.67%)+478k (+ 0.25%)194,152k197,381k
Parse Time1.79s (± 1.29%)1.80s (± 0.57%)+0.02s (+ 0.84%)1.79s1.82s
Bind Time0.84s (± 0.97%)0.85s (± 0.74%)+0.01s (+ 0.79%)0.84s0.86s
Check Time10.39s (± 0.45%)10.35s (± 0.83%)-0.04s (- 0.37%)10.26s10.48s
Emit Time3.06s (± 1.27%)3.07s (± 1.32%)+0.01s (+ 0.22%)3.02s3.13s
Total Time16.08s (± 0.50%)16.07s (± 0.39%)-0.01s (- 0.07%)16.00s16.15s
Monaco - node (v16.17.1, x64)
Memory used343,232k (± 0.01%)343,226k (± 0.01%)-6k (- 0.00%)343,188k343,272k
Parse Time3.17s (± 0.88%)3.16s (± 0.82%)-0.01s (- 0.26%)3.12s3.20s
Bind Time1.12s (± 0.46%)1.11s (± 0.68%)-0.01s (- 0.75%)1.10s1.12s
Check Time7.90s (± 0.15%)7.71s (± 0.20%)-0.19s (- 2.43%)7.69s7.73s
Emit Time4.54s (± 0.32%)4.51s (± 0.41%)-0.03s (- 0.59%)4.49s4.54s
Total Time16.72s (± 0.21%)16.48s (± 0.22%)-0.24s (- 1.43%)16.42s16.52s
TFS - node (v16.17.1, x64)
Memory used299,700k (± 0.00%)299,770k (± 0.00%)+71k (+ 0.02%)299,747k299,788k
Parse Time2.48s (± 1.21%)2.46s (± 1.01%)-0.02s (- 0.87%)2.43s2.49s
Bind Time1.25s (± 0.44%)1.25s (± 0.60%)-0.00s (- 0.27%)1.24s1.26s
Check Time7.53s (± 0.16%)7.17s (± 0.41%)🟩-0.36s (- 4.82%)7.12s7.20s
Emit Time4.26s (± 0.59%)4.23s (± 0.57%)-0.04s (- 0.86%)4.19s4.25s
Total Time15.53s (± 0.22%)15.11s (± 0.27%)-0.42s (- 2.73%)15.08s15.19s
material-ui - node (v16.17.1, x64)
Memory used476,090k (± 0.02%)476,118k (± 0.02%)+28k (+ 0.01%)476,025k476,215k
Parse Time3.72s (± 0.29%)3.72s (± 0.22%)-0.00s (- 0.09%)3.71s3.73s
Bind Time1.02s (± 0.40%)1.02s (± 0.74%)-0.00s (- 0.33%)1.01s1.03s
Check Time18.10s (± 0.49%)18.13s (± 0.23%)+0.03s (+ 0.18%)18.07s18.20s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.84s (± 0.44%)22.86s (± 0.22%)+0.02s (+ 0.11%)22.79s22.94s
xstate - node (v16.17.1, x64)
Memory used546,230k (± 0.02%)546,166k (± 0.00%)-65k (- 0.01%)546,141k546,186k
Parse Time4.77s (± 0.34%)4.77s (± 0.41%)-0.00s (- 0.10%)4.74s4.80s
Bind Time1.82s (± 3.96%)1.85s (± 0.28%)+0.03s (+ 1.65%)1.84s1.85s
Check Time3.01s (± 2.61%)2.96s (± 0.62%)-0.05s (- 1.61%)2.93s2.98s
Emit Time0.09s (± 4.45%)0.09s (± 4.45%)0.00s ( 0.00%)0.09s0.10s
Total Time9.70s (± 0.25%)9.67s (± 0.20%)-0.02s (- 0.24%)9.64s9.69s

System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
BenchmarkNameIterations
Current523826
Baselinemain6

Developer Information:

Download Benchmark

@jakebailey
Copy link
MemberAuthor

Perf seems the same as the first run (though I only checked node 16 via the short test; node 18 appears to do better). Are we good with this PR in this state for the beta?

@jakebaileyjakebailey merged commit0141d1d intomicrosoft:mainJan 25, 2023
@jakebaileyjakebailey deleted the pooled-printers branchJanuary 25, 2023 19:59
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@weswighamweswighamweswigham approved these changes

@DanielRosenwasserDanielRosenwasserDanielRosenwasser approved these changes

Assignees

@jakebaileyjakebailey

Labels
Author: TeamFor Uncommitted BugPR for untriaged, rejected, closed or missing bug
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@jakebailey@typescript-bot@DanielRosenwasser@weswigham

[8]ページ先頭

©2009-2025 Movatter.jp