Skip to content

Skip parsing JSDoc in .ts files - #52466

Closed
Nathan Shively-Sanders (sandersn) wants to merge 7 commits into
microsoft:mainfrom
sandersn:tsc-skips-jsdoc-in-ts
Closed

Skip parsing JSDoc in .ts files#52466
Nathan Shively-Sanders (sandersn) wants to merge 7 commits into
microsoft:mainfrom
sandersn:tsc-skips-jsdoc-in-ts

Conversation

@sandersn

@sandersnNathan Shively-Sanders (sandersn) commented Jan 27, 2023

Copy link
Copy Markdown
Member

Just an experiment for now. JSDoc is still parsed

  1. in tsserver
  2. in .js files
  3. when the comment contains @link or @see

An alternative would make the parser parse lazily, and instead have the checker skip checking in the above conditions. After thinking about it, I'm not sure that's much better.

Just an experiment for now. Current test failures:
- all fourslash tests of jsdoc fail; the parser should produce jsdoc
for tsserver.
- Spurious unused-type errors because `@link` isn't parsed and treated
as a usage.
- ohhh no, `@this` is mistakenly interpreted in .ts files:
thisInFunctionCall.
@sandersn

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 27, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the perf test suite on this PR at 5d585f6. You can monitor the build here.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used359,849k (± 0.01%)348,991k (± 0.01%)🟩-10,857k (- 3.02%)348,970k349,021k
Parse Time3.93s (± 0.86%)3.18s (± 0.62%)🟩-0.75s (-19.07%)3.15s3.20s
Bind Time1.17s (± 0.47%)1.13s (± 0.91%)🟩-0.04s (- 3.55%)1.12s1.15s
Check Time8.66s (± 0.52%)8.57s (± 0.27%)-0.09s (- 1.04%)8.54s8.60s
Emit Time7.63s (± 0.46%)7.83s (± 0.78%)+0.20s (+ 2.62%)7.77s7.93s
Total Time21.39s (± 0.36%)20.71s (± 0.33%)🟩-0.68s (- 3.18%)20.64s20.83s
Compiler-Unions - node (v18.10.0, x64)
Memory used192,550k (± 0.07%)191,435k (± 1.20%)-1,114k (- 0.58%)190,449k196,140k
Parse Time1.65s (± 2.58%)1.44s (± 2.56%)🟩-0.21s (-12.90%)1.38s1.47s
Bind Time0.80s (± 1.30%)0.75s (± 0.68%)🟩-0.04s (- 5.44%)0.75s0.76s
Check Time9.64s (± 1.06%)9.62s (± 0.67%)-0.02s (- 0.22%)9.52s9.71s
Emit Time2.87s (± 4.51%)2.81s (± 0.57%)-0.06s (- 2.21%)2.78s2.82s
Total Time14.96s (± 0.95%)14.62s (± 0.62%)-0.34s (- 2.28%)14.51s14.76s
Monaco - node (v18.10.0, x64)
Memory used343,992k (± 0.01%)342,535k (± 0.01%)-1,457k (- 0.42%)342,501k342,585k
Parse Time2.94s (± 0.82%)2.85s (± 0.41%)🟩-0.09s (- 3.17%)2.84s2.87s
Bind Time1.03s (± 1.06%)1.01s (± 0.51%)-0.02s (- 1.62%)1.01s1.02s
Check Time7.03s (± 0.57%)7.00s (± 0.48%)-0.04s (- 0.50%)6.96s7.06s
Emit Time4.31s (± 0.41%)4.31s (± 0.62%)-0.00s (- 0.00%)4.29s4.36s
Total Time15.33s (± 0.41%)15.17s (± 0.31%)-0.16s (- 1.02%)15.11s15.22s
TFS - node (v18.10.0, x64)
Memory used300,372k (± 0.01%)300,468k (± 0.01%)+96k (+ 0.03%)300,450k300,507k
Parse Time2.25s (± 1.08%)2.26s (± 0.93%)+0.01s (+ 0.59%)2.23s2.28s
Bind Time1.17s (± 0.54%)0.95s (± 0.67%)🟩-0.22s (-18.80%)0.94s0.96s
Check Time6.51s (± 0.43%)6.83s (± 0.48%)+0.32s (+ 4.84%)6.78s6.88s
Emit Time3.92s (± 0.39%)3.93s (± 1.01%)+0.01s (+ 0.34%)3.88s3.99s
Total Time13.84s (± 0.33%)13.96s (± 0.36%)+0.12s (+ 0.87%)13.92s14.06s
material-ui - node (v18.10.0, x64)
Memory used476,716k (± 0.01%)462,848k (± 0.01%)-13,868k (- 2.91%)462,785k462,901k
Parse Time3.57s (± 0.35%)2.60s (± 0.57%)🟩-0.97s (-27.22%)2.58s2.62s
Bind Time0.97s (± 0.65%)1.10s (± 0.47%)+0.13s (+13.06%)1.09s1.10s
Check Time17.05s (± 0.50%)17.04s (± 0.36%)-0.01s (- 0.05%)16.94s17.11s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time21.59s (± 0.40%)20.74s (± 0.30%)🟩-0.85s (- 3.94%)20.64s20.83s
xstate - node (v18.10.0, x64)
Memory used548,657k (± 0.02%)497,591k (± 0.01%)🟩-51,067k (- 9.31%)497,545k497,660k
Parse Time4.57s (± 0.45%)2.97s (± 1.60%)🟩-1.60s (-35.01%)2.91s3.03s
Bind Time1.71s (± 1.03%)1.51s (± 0.65%)🟩-0.20s (-11.62%)1.50s1.52s
Check Time2.73s (± 0.63%)2.88s (± 0.61%)+0.15s (+ 5.44%)2.86s2.91s
Emit Time0.09s (± 5.95%)0.09s (± 0.00%)+0.00s (+ 3.85%)0.09s0.09s
Total Time9.09s (± 0.43%)7.44s (± 0.46%)🟩-1.65s (-18.12%)7.39s7.48s
Angular - node (v16.17.1, x64)
Memory used359,219k (± 0.00%)348,349k (± 0.01%)🟩-10,870k (- 3.03%)348,285k348,405k
Parse Time4.18s (± 0.24%)3.37s (± 0.69%)🟩-0.81s (-19.31%)3.34s3.41s
Bind Time1.23s (± 1.11%)1.19s (± 0.43%)-0.03s (- 2.72%)1.19s1.20s
Check Time9.40s (± 0.33%)9.30s (± 0.29%)-0.10s (- 1.03%)9.27s9.34s
Emit Time8.05s (± 0.76%)8.27s (± 0.44%)+0.22s (+ 2.69%)8.21s8.31s
Total Time22.85s (± 0.32%)22.13s (± 0.13%)🟩-0.73s (- 3.17%)22.09s22.17s
Compiler-Unions - node (v16.17.1, x64)
Memory used195,380k (± 0.90%)192,175k (± 0.02%)-3,205k (- 1.64%)192,116k192,211k
Parse Time1.81s (± 0.65%)1.63s (± 0.84%)🟩-0.18s (-10.05%)1.61s1.64s
Bind Time0.84s (± 0.48%)0.80s (± 0.51%)🟩-0.04s (- 5.15%)0.79s0.80s
Check Time10.39s (± 0.72%)10.31s (± 0.47%)-0.07s (- 0.71%)10.25s10.39s
Emit Time3.05s (± 0.25%)3.05s (± 1.07%)+0.01s (+ 0.22%)3.02s3.11s
Total Time16.08s (± 0.52%)15.79s (± 0.34%)-0.29s (- 1.81%)15.69s15.84s
Monaco - node (v16.17.1, x64)
Memory used343,240k (± 0.01%)341,860k (± 0.01%)-1,380k (- 0.40%)341,846k341,895k
Parse Time3.17s (± 1.01%)3.04s (± 1.12%)🟩-0.13s (- 4.21%)2.99s3.08s
Bind Time1.11s (± 0.89%)1.08s (± 0.70%)-0.03s (- 2.41%)1.07s1.09s
Check Time7.71s (± 0.32%)7.71s (± 0.53%)-0.00s (- 0.02%)7.66s7.78s
Emit Time4.54s (± 0.62%)4.53s (± 0.40%)-0.00s (- 0.11%)4.50s4.55s
Total Time16.53s (± 0.38%)16.36s (± 0.47%)-0.17s (- 1.03%)16.25s16.47s
TFS - node (v16.17.1, x64)
Memory used299,761k (± 0.01%)299,850k (± 0.01%)+89k (+ 0.03%)299,829k299,876k
Parse Time2.47s (± 1.08%)2.48s (± 1.40%)+0.02s (+ 0.61%)2.45s2.55s
Bind Time1.25s (± 0.41%)1.01s (± 0.75%)🟩-0.25s (-19.55%)1.00s1.02s
Check Time7.20s (± 0.43%)7.48s (± 0.37%)+0.27s (+ 3.79%)7.44s7.52s
Emit Time4.22s (± 1.01%)4.20s (± 0.49%)-0.02s (- 0.43%)4.17s4.23s
Total Time15.14s (± 0.45%)15.18s (± 0.34%)+0.03s (+ 0.21%)15.12s15.26s
material-ui - node (v16.17.1, x64)
Memory used476,048k (± 0.02%)462,153k (± 0.02%)-13,895k (- 2.92%)462,075k462,274k
Parse Time3.71s (± 0.15%)2.70s (± 0.45%)🟩-1.01s (-27.23%)2.69s2.72s
Bind Time1.02s (± 0.00%)1.17s (± 0.54%)+0.15s (+14.71%)1.16s1.18s
Check Time18.05s (± 0.39%)18.11s (± 0.76%)+0.06s (+ 0.34%)18.03s18.38s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.78s (± 0.32%)21.99s (± 0.62%)🟩-0.79s (- 3.49%)21.90s22.26s
xstate - node (v16.17.1, x64)
Memory used546,239k (± 0.02%)495,504k (± 0.03%)🟩-50,735k (- 9.29%)495,295k495,718k
Parse Time4.74s (± 0.28%)3.14s (± 0.24%)🟩-1.60s (-33.81%)3.13s3.15s
Bind Time1.78s (± 4.71%)1.59s (± 0.51%)🟩-0.19s (-10.94%)1.58s1.60s
Check Time3.01s (± 2.95%)3.15s (± 0.58%)+0.14s (+ 4.76%)3.12s3.17s
Emit Time0.09s (± 5.53%)0.09s (± 4.45%)-0.00s (- 1.79%)0.09s0.10s
Total Time9.62s (± 0.42%)7.98s (± 0.22%)🟩-1.65s (-17.11%)7.95s8.00s
Angular - node (v14.15.1, x64)
Memory used352,827k (± 0.01%)342,213k (± 0.01%)🟩-10,615k (- 3.01%)342,174k342,241k
Parse Time4.23s (± 0.38%)3.51s (± 0.84%)🟩-0.72s (-17.11%)3.47s3.55s
Bind Time1.28s (± 0.49%)1.24s (± 0.51%)🟩-0.04s (- 3.13%)1.23s1.25s
Check Time9.66s (± 0.50%)9.60s (± 0.41%)-0.06s (- 0.66%)9.54s9.66s
Emit Time8.41s (± 0.69%)8.60s (± 0.60%)+0.18s (+ 2.14%)8.54s8.68s
Total Time23.59s (± 0.19%)22.93s (± 0.40%)-0.65s (- 2.77%)22.85s23.11s
Compiler-Unions - node (v14.15.1, x64)
Memory used189,194k (± 0.07%)187,513k (± 0.02%)-1,681k (- 0.89%)187,462k187,572k
Parse Time1.85s (± 0.44%)1.66s (± 0.62%)🟩-0.18s (- 9.93%)1.65s1.68s
Bind Time0.86s (± 0.60%)0.82s (± 1.48%)🟩-0.04s (- 4.67%)0.81s0.84s
Check Time10.39s (± 0.45%)10.33s (± 0.40%)-0.06s (- 0.58%)10.28s10.40s
Emit Time3.38s (± 5.21%)3.16s (± 1.34%)🟩-0.22s (- 6.36%)3.10s3.21s
Total Time16.47s (± 1.26%)15.98s (± 0.45%)🟩-0.49s (- 3.00%)15.91s16.11s
Monaco - node (v14.15.1, x64)
Memory used338,025k (± 0.00%)336,730k (± 0.02%)-1,296k (- 0.38%)336,684k336,812k
Parse Time3.22s (± 0.67%)3.06s (± 1.16%)🟩-0.16s (- 5.02%)3.02s3.10s
Bind Time1.11s (± 0.68%)1.10s (± 0.47%)-0.01s (- 1.05%)1.09s1.10s
Check Time8.06s (± 0.26%)8.01s (± 0.44%)-0.05s (- 0.62%)7.96s8.05s
Emit Time4.77s (± 0.81%)4.75s (± 0.45%)-0.02s (- 0.35%)4.71s4.77s
Total Time17.16s (± 0.24%)16.92s (± 0.44%)-0.24s (- 1.39%)16.79s17.01s
TFS - node (v14.15.1, x64)
Memory used294,575k (± 0.00%)294,781k (± 0.00%)+206k (+ 0.07%)294,768k294,799k
Parse Time2.74s (± 0.58%)2.71s (± 1.16%)-0.04s (- 1.28%)2.65s2.74s
Bind Time1.11s (± 0.47%)1.09s (± 1.35%)-0.02s (- 1.36%)1.08s1.12s
Check Time7.51s (± 0.40%)7.53s (± 0.41%)+0.02s (+ 0.27%)7.49s7.57s
Emit Time4.62s (± 0.24%)4.61s (± 0.53%)-0.01s (- 0.11%)4.58s4.65s
Total Time15.98s (± 0.24%)15.94s (± 0.50%)-0.04s (- 0.23%)15.82s16.05s
material-ui - node (v14.15.1, x64)
Memory used471,559k (± 0.00%)457,993k (± 0.00%)-13,566k (- 2.88%)457,963k458,009k
Parse Time3.93s (± 0.57%)3.09s (± 0.48%)🟩-0.84s (-21.30%)3.08s3.11s
Bind Time1.05s (± 0.85%)0.98s (± 1.29%)🟩-0.07s (- 6.67%)0.96s1.00s
Check Time19.05s (± 0.35%)18.48s (± 0.30%)🟩-0.58s (- 3.04%)18.40s18.57s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time24.03s (± 0.32%)22.55s (± 0.29%)🟩-1.49s (- 6.19%)22.46s22.65s
xstate - node (v14.15.1, x64)
Memory used534,446k (± 0.01%)484,048k (± 0.01%)🟩-50,398k (- 9.43%)484,024k484,094k
Parse Time5.12s (± 0.29%)3.36s (± 1.03%)🟩-1.77s (-34.46%)3.31s3.40s
Bind Time1.70s (± 0.53%)1.78s (± 0.66%)+0.08s (+ 4.61%)1.77s1.80s
Check Time3.10s (± 0.67%)3.08s (± 0.76%)-0.02s (- 0.59%)3.05s3.11s
Emit Time0.10s (± 0.00%)0.10s (± 0.00%)0.00s ( 0.00%)0.10s0.10s
Total Time10.02s (± 0.28%)8.32s (± 0.65%)🟩-1.70s (-16.97%)8.25s8.38s
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
Current524666
Baselinemain6

TSServer

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,525ms (± 1.72%)2,260ms (± 0.51%)🟩-265ms (-10.50%)2,243ms2,273ms
Req 2 - geterr5,505ms (± 0.65%)5,466ms (± 1.04%)-39ms (- 0.70%)5,401ms5,558ms
Req 3 - references365ms (± 0.84%)357ms (± 2.15%)-8ms (- 2.28%)349ms370ms
Req 4 - navto284ms (± 1.03%)279ms (± 0.27%)-6ms (- 1.93%)278ms280ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo66ms (± 0.96%)62ms (± 0.84%)🟩-4ms (- 6.57%)61ms62ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,727ms (± 1.11%)2,499ms (± 2.10%)🟩-228ms (- 8.35%)2,425ms2,548ms
Req 2 - geterr4,060ms (± 0.40%)4,061ms (± 0.24%)+1ms (+ 0.03%)4,047ms4,072ms
Req 3 - references368ms (± 0.76%)367ms (± 0.53%)-0ms (- 0.05%)364ms370ms
Req 4 - navto299ms (± 0.77%)293ms (± 0.41%)-7ms (- 2.17%)291ms294ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo81ms (± 2.12%)73ms (± 1.22%)🟩-8ms (-10.06%)72ms74ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,507ms (± 0.64%)2,635ms (± 0.58%)🟩-872ms (-24.86%)2,618ms2,653ms
Req 2 - geterr1,429ms (± 1.45%)1,424ms (± 0.81%)-5ms (- 0.35%)1,410ms1,441ms
Req 3 - references105ms (± 1.89%)110ms (± 0.00%)+6ms (+ 5.26%)110ms110ms
Req 4 - navto358ms (± 1.63%)359ms (± 0.99%)+1ms (+ 0.33%)355ms365ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo468ms (± 1.49%)455ms (± 1.99%)-13ms (- 2.67%)444ms467ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,777ms (± 0.31%)2,555ms (± 0.98%)🟩-223ms (- 8.01%)2,509ms2,583ms
Req 2 - geterr5,878ms (± 0.50%)5,864ms (± 0.34%)-14ms (- 0.24%)5,835ms5,886ms
Req 3 - references377ms (± 1.36%)362ms (± 1.13%)🟩-14ms (- 3.81%)358ms370ms
Req 4 - navto278ms (± 0.79%)274ms (± 0.84%)-4ms (- 1.38%)271ms278ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo76ms (± 8.87%)70ms (± 3.93%)🟩-6ms (- 8.10%)66ms73ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,941ms (± 0.70%)2,670ms (± 1.09%)🟩-272ms (- 9.24%)2,629ms2,699ms
Req 2 - geterr4,408ms (± 0.44%)4,371ms (± 0.17%)-37ms (- 0.84%)4,358ms4,380ms
Req 3 - references379ms (± 0.73%)375ms (± 0.75%)-4ms (- 0.92%)372ms380ms
Req 4 - navto287ms (± 0.62%)290ms (± 0.38%)+3ms (+ 1.05%)289ms292ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo72ms (± 0.72%)79ms (± 1.03%)+8ms (+10.70%)78ms80ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,628ms (± 0.17%)2,755ms (± 0.24%)🟩-872ms (-24.05%)2,744ms2,761ms
Req 2 - geterr1,559ms (± 0.61%)1,562ms (± 1.24%)+3ms (+ 0.18%)1,536ms1,593ms
Req 3 - references112ms (± 1.85%)116ms (± 0.89%)+5ms (+ 4.18%)115ms118ms
Req 4 - navto342ms (± 1.06%)347ms (± 1.07%)+5ms (+ 1.46%)343ms351ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo481ms (± 0.73%)468ms (± 0.80%)-13ms (- 2.67%)463ms472ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,902ms (± 0.26%)2,670ms (± 0.31%)🟩-233ms (- 8.01%)2,657ms2,680ms
Req 2 - geterr6,258ms (± 0.53%)6,212ms (± 0.92%)-46ms (- 0.73%)6,138ms6,307ms
Req 3 - references390ms (± 0.78%)371ms (± 1.26%)🟩-20ms (- 5.04%)366ms379ms
Req 4 - navto283ms (± 1.43%)280ms (± 2.20%)-3ms (- 1.00%)275ms289ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo85ms (± 9.12%)88ms (±11.31%)+3ms (+ 3.13%)72ms95ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,078ms (± 0.61%)2,824ms (± 0.32%)🟩-254ms (- 8.24%)2,810ms2,831ms
Req 2 - geterr4,698ms (± 0.42%)4,651ms (± 0.45%)-47ms (- 1.00%)4,632ms4,690ms
Req 3 - references404ms (± 0.53%)388ms (± 0.55%)🟩-16ms (- 3.96%)385ms391ms
Req 4 - navto292ms (± 1.00%)294ms (± 1.55%)+2ms (+ 0.57%)288ms299ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo83ms (± 4.32%)74ms (± 1.14%)🟩-9ms (-10.91%)73ms75ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,989ms (± 0.61%)2,862ms (± 0.24%)🟩-1,127ms (-28.26%)2,851ms2,872ms
Req 2 - geterr1,524ms (± 1.32%)1,546ms (± 0.67%)+22ms (+ 1.42%)1,531ms1,559ms
Req 3 - references132ms (± 1.51%)130ms (± 2.11%)-2ms (- 1.77%)125ms133ms
Req 4 - navto373ms (± 0.81%)371ms (± 0.81%)-1ms (- 0.36%)368ms375ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo511ms (± 2.03%)492ms (± 2.95%)🟩-19ms (- 3.78%)472ms502ms
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
Current524666
Baselinemain6

Startup

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time141.85ms (± 0.14%)142.43ms (± 0.18%)+0.58ms (+ 0.41%)141.73ms147.28ms
tsserver-startup - node (v16.17.1, x64)
Execution time225.50ms (± 0.17%)226.93ms (± 0.19%)+1.43ms (+ 0.63%)226.05ms234.38ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time227.93ms (± 0.15%)229.12ms (± 0.21%)+1.20ms (+ 0.52%)228.17ms239.93ms
typescript-startup - node (v16.17.1, x64)
Execution time208.91ms (± 0.16%)209.99ms (± 0.17%)+1.07ms (+ 0.51%)209.11ms216.91ms
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
Current524666
Baselinemain6

Developer Information:

Download Benchmark

@jakebailey

Copy link
Copy Markdown
Member

Holy moly, we spend that much time on JSDoc?

@sandersn

Copy link
Copy Markdown
MemberAuthor

Yes

@sandersn

Copy link
Copy Markdown
MemberAuthor

Yep. Yes indeed.

@sandersnNathan Shively-Sanders (sandersn) changed the title Skip JSDoc in .ts filesSkip parsing JSDoc in .ts filesJan 27, 2023
@sandersn

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 27, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the perf test suite on this PR at 3d5d2a6. You can monitor the build here.

Update: The results are in!

@weswigham

Copy link
Copy Markdown
Member

This looks great, hah. Do the parser time savings in our benches correspond, percentage-wise, with how much text is jsdoc, or does jsdoc have an outsized parse time impact? I ask because, if the later, it may still be worth also looking at if we can make jsdoc parsing faster for the sake of LS operations that actually need the jsdoc.

@sandersn

Nathan Shively-Sanders (sandersn) commented Jan 27, 2023

Copy link
Copy Markdown
MemberAuthor

Do the parser time savings in our benches correspond, percentage-wise?

Uhhh, not really? Correlation is 27%, which is not high, although xstate is kind of an outlier and if you drop it the correlation is 66%. It's definitely worth investigating jsdoc parsing.

Edit: There are only 50,000 characters of comments in xstate so I looked at all of them. There's nothing interesting there, unless we are pathologically bad at parsing the one or two markdown links. I think it's the perf tests being wonky, so let's see what the second run results are like.

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used359,841k (± 0.02%)359,810k (± 0.02%)-32k (- 0.01%)359,722k359,896k
Parse Time3.96s (± 0.76%)3.96s (± 0.49%)-0.01s (- 0.17%)3.94s3.99s
Bind Time1.17s (± 0.47%)1.17s (± 0.00%)-0.00s (- 0.43%)1.17s1.17s
Check Time8.64s (± 0.57%)8.61s (± 0.31%)-0.03s (- 0.31%)8.58s8.64s
Emit Time7.62s (± 0.59%)7.58s (± 0.54%)-0.04s (- 0.48%)7.54s7.65s
Total Time21.40s (± 0.34%)21.32s (± 0.35%)-0.07s (- 0.34%)21.24s21.44s
Compiler-Unions - node (v18.10.0, x64)
Memory used194,520k (± 1.51%)195,361k (± 1.57%)+841k (+ 0.43%)192,325k198,218k
Parse Time1.64s (± 1.41%)1.63s (± 1.62%)-0.01s (- 0.81%)1.59s1.65s
Bind Time0.80s (± 0.69%)0.79s (± 0.00%)-0.01s (- 0.63%)0.79s0.79s
Check Time9.67s (± 0.96%)9.64s (± 1.04%)-0.03s (- 0.29%)9.54s9.81s
Emit Time2.81s (± 2.25%)2.86s (± 4.14%)+0.05s (+ 1.66%)2.79s3.10s
Total Time14.92s (± 0.62%)14.91s (± 0.99%)-0.00s (- 0.01%)14.78s15.12s
Monaco - node (v18.10.0, x64)
Memory used343,959k (± 0.01%)344,009k (± 0.02%)+50k (+ 0.01%)343,925k344,076k
Parse Time2.96s (± 0.85%)2.95s (± 0.61%)-0.01s (- 0.34%)2.92s2.97s
Bind Time1.04s (± 1.12%)1.04s (± 1.12%)-0.00s (- 0.32%)1.02s1.05s
Check Time7.05s (± 0.56%)7.02s (± 0.64%)-0.03s (- 0.40%)6.97s7.09s
Emit Time4.32s (± 0.79%)4.34s (± 1.32%)+0.02s (+ 0.42%)4.29s4.45s
Total Time15.37s (± 0.23%)15.35s (± 0.55%)-0.02s (- 0.13%)15.26s15.50s
TFS - node (v18.10.0, x64)
Memory used300,378k (± 0.00%)300,373k (± 0.01%)-5k (- 0.00%)300,345k300,401k
Parse Time2.27s (± 1.14%)2.23s (± 0.67%)-0.04s (- 1.83%)2.22s2.26s
Bind Time1.17s (± 0.00%)1.17s (± 1.00%)+0.00s (+ 0.14%)1.16s1.19s
Check Time6.55s (± 0.80%)6.50s (± 0.40%)-0.06s (- 0.89%)6.46s6.53s
Emit Time3.93s (± 0.82%)3.91s (± 0.60%)-0.02s (- 0.38%)3.88s3.94s
Total Time13.93s (± 0.72%)13.81s (± 0.33%)-0.12s (- 0.84%)13.75s13.88s
material-ui - node (v18.10.0, x64)
Memory used476,715k (± 0.00%)476,726k (± 0.01%)+12k (+ 0.00%)476,677k476,818k
Parse Time3.56s (± 0.63%)3.55s (± 1.66%)-0.02s (- 0.47%)3.44s3.60s
Bind Time0.97s (± 0.65%)0.99s (± 4.18%)+0.02s (+ 1.72%)0.96s1.07s
Check Time17.15s (± 0.80%)17.07s (± 0.78%)-0.08s (- 0.47%)16.91s17.21s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time21.68s (± 0.63%)21.61s (± 0.72%)-0.08s (- 0.37%)21.39s21.77s
xstate - node (v18.10.0, x64)
Memory used548,604k (± 0.01%)548,615k (± 0.02%)+11k (+ 0.00%)548,540k548,752k
Parse Time4.56s (± 0.66%)4.55s (± 0.45%)-0.02s (- 0.37%)4.52s4.57s
Bind Time1.71s (± 0.68%)1.70s (± 1.25%)-0.01s (- 0.58%)1.67s1.73s
Check Time2.73s (± 1.10%)2.74s (± 0.55%)+0.01s (+ 0.37%)2.72s2.75s
Emit Time0.08s (± 0.00%)0.08s (± 6.19%)+0.00s (+ 4.17%)0.08s0.09s
Total Time9.09s (± 0.38%)9.08s (± 0.56%)-0.02s (- 0.18%)9.02s9.14s
Angular - node (v16.17.1, x64)
Memory used359,216k (± 0.01%)359,215k (± 0.00%)-1k (- 0.00%)359,191k359,237k
Parse Time4.19s (± 0.41%)4.18s (± 0.23%)-0.01s (- 0.16%)4.17s4.19s
Bind Time1.22s (± 0.84%)1.23s (± 0.66%)+0.00s (+ 0.27%)1.21s1.23s
Check Time9.39s (± 0.41%)9.40s (± 0.38%)+0.01s (+ 0.05%)9.35s9.45s
Emit Time8.07s (± 0.71%)8.06s (± 0.47%)-0.01s (- 0.14%)8.00s8.10s
Total Time22.87s (± 0.40%)22.86s (± 0.29%)-0.01s (- 0.04%)22.80s22.97s
Compiler-Unions - node (v16.17.1, x64)
Memory used194,849k (± 0.76%)194,204k (± 0.03%)-645k (- 0.33%)194,170k194,335k
Parse Time1.80s (± 0.57%)1.80s (± 0.45%)+0.00s (+ 0.00%)1.79s1.81s
Bind Time0.84s (± 1.17%)0.85s (± 0.48%)+0.01s (+ 1.59%)0.85s0.86s
Check Time10.36s (± 0.49%)10.34s (± 0.31%)-0.03s (- 0.26%)10.29s10.37s
Emit Time3.05s (± 0.87%)3.05s (± 0.40%)+0.01s (+ 0.27%)3.04s3.07s
Total Time16.05s (± 0.36%)16.04s (± 0.17%)-0.01s (- 0.04%)16.01s16.08s
Monaco - node (v16.17.1, x64)
Memory used343,253k (± 0.01%)343,304k (± 0.01%)+52k (+ 0.02%)343,241k343,353k
Parse Time3.18s (± 1.01%)3.18s (± 1.37%)+0.00s (+ 0.05%)3.12s3.25s
Bind Time1.11s (± 0.95%)1.12s (± 0.46%)+0.01s (+ 1.06%)1.11s1.12s
Check Time7.74s (± 0.48%)7.71s (± 0.30%)-0.03s (- 0.45%)7.67s7.74s
Emit Time4.52s (± 0.74%)4.55s (± 0.49%)+0.03s (+ 0.63%)4.51s4.57s
Total Time16.55s (± 0.38%)16.56s (± 0.39%)+0.01s (+ 0.04%)16.47s16.65s
TFS - node (v16.17.1, x64)
Memory used299,756k (± 0.00%)299,756k (± 0.00%)-0k (- 0.00%)299,736k299,770k
Parse Time2.47s (± 1.53%)2.48s (± 1.00%)+0.01s (+ 0.34%)2.44s2.51s
Bind Time1.25s (± 0.60%)1.25s (± 0.00%)-0.00s (- 0.13%)1.25s1.25s
Check Time7.18s (± 0.44%)7.19s (± 0.39%)+0.01s (+ 0.07%)7.16s7.24s
Emit Time4.24s (± 0.86%)4.20s (± 0.37%)-0.04s (- 0.98%)4.18s4.22s
Total Time15.15s (± 0.33%)15.13s (± 0.38%)-0.03s (- 0.19%)15.08s15.22s
material-ui - node (v16.17.1, x64)
Memory used476,064k (± 0.02%)476,074k (± 0.01%)+10k (+ 0.00%)476,007k476,147k
Parse Time3.71s (± 0.22%)3.73s (± 0.22%)+0.01s (+ 0.27%)3.72s3.74s
Bind Time1.02s (± 0.80%)1.02s (± 0.62%)-0.00s (- 0.33%)1.01s1.03s
Check Time18.16s (± 0.46%)18.15s (± 0.57%)-0.01s (- 0.06%)18.02s18.31s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.90s (± 0.38%)22.90s (± 0.47%)-0.00s (- 0.01%)22.76s23.07s
xstate - node (v16.17.1, x64)
Memory used546,223k (± 0.02%)546,239k (± 0.01%)+16k (+ 0.00%)546,198k546,380k
Parse Time4.77s (± 0.28%)4.76s (± 0.57%)-0.01s (- 0.14%)4.73s4.81s
Bind Time1.83s (± 0.75%)1.84s (± 0.44%)+0.00s (+ 0.09%)1.83s1.85s
Check Time2.97s (± 0.46%)2.97s (± 0.55%)-0.00s (- 0.06%)2.94s2.98s
Emit Time0.10s (± 5.76%)0.10s (± 5.76%)0.00s ( 0.00%)0.09s0.10s
Total Time9.67s (± 0.17%)9.66s (± 0.41%)-0.01s (- 0.09%)9.61s9.72s
Angular - node (v14.15.1, x64)
Memory used352,853k (± 0.00%)352,826k (± 0.01%)-27k (- 0.01%)352,790k352,910k
Parse Time4.24s (± 0.58%)4.23s (± 0.36%)-0.01s (- 0.31%)4.21s4.25s
Bind Time1.29s (± 0.63%)1.28s (± 0.85%)-0.01s (- 0.52%)1.26s1.29s
Check Time9.72s (± 0.38%)9.69s (± 0.36%)-0.03s (- 0.31%)9.64s9.74s
Emit Time8.40s (± 0.73%)8.35s (± 0.46%)-0.05s (- 0.60%)8.30s8.41s
Total Time23.64s (± 0.38%)23.55s (± 0.25%)-0.10s (- 0.41%)23.46s23.61s
Compiler-Unions - node (v14.15.1, x64)
Memory used190,178k (± 0.87%)189,091k (± 0.01%)-1,087k (- 0.57%)189,074k189,108k
Parse Time1.84s (± 0.49%)1.85s (± 0.41%)+0.01s (+ 0.63%)1.84s1.86s
Bind Time0.86s (± 0.73%)0.86s (± 0.48%)-0.00s (- 0.19%)0.85s0.86s
Check Time10.37s (± 0.59%)10.34s (± 0.69%)-0.03s (- 0.27%)10.26s10.46s
Emit Time3.46s (± 1.15%)3.47s (± 1.88%)+0.01s (+ 0.24%)3.39s3.55s
Total Time16.54s (± 0.63%)16.53s (± 0.73%)-0.01s (- 0.05%)16.41s16.73s
Monaco - node (v14.15.1, x64)
Memory used338,019k (± 0.01%)338,026k (± 0.00%)+8k (+ 0.00%)338,012k338,049k
Parse Time3.22s (± 1.09%)3.24s (± 0.73%)+0.02s (+ 0.62%)3.21s3.26s
Bind Time1.11s (± 0.68%)1.11s (± 0.37%)+0.00s (+ 0.30%)1.11s1.12s
Check Time8.05s (± 0.26%)8.03s (± 0.35%)-0.03s (- 0.33%)8.00s8.08s
Emit Time4.76s (± 0.39%)4.74s (± 0.34%)-0.02s (- 0.35%)4.73s4.77s
Total Time17.14s (± 0.26%)17.12s (± 0.31%)-0.02s (- 0.15%)17.05s17.17s
TFS - node (v14.15.1, x64)
Memory used294,588k (± 0.01%)294,606k (± 0.01%)+18k (+ 0.01%)294,583k294,628k
Parse Time2.74s (± 0.72%)2.75s (± 0.51%)+0.01s (+ 0.18%)2.73s2.77s
Bind Time1.11s (± 0.37%)1.10s (± 1.41%)-0.01s (- 1.05%)1.08s1.12s
Check Time7.50s (± 0.66%)7.50s (± 0.40%)-0.00s (- 0.04%)7.45s7.53s
Emit Time4.60s (± 0.58%)4.59s (± 0.67%)-0.01s (- 0.14%)4.56s4.64s
Total Time15.96s (± 0.36%)15.94s (± 0.32%)-0.02s (- 0.15%)15.89s16.03s
material-ui - node (v14.15.1, x64)
Memory used471,562k (± 0.00%)471,559k (± 0.00%)-3k (- 0.00%)471,539k471,569k
Parse Time3.93s (± 0.71%)3.92s (± 0.45%)-0.01s (- 0.21%)3.90s3.95s
Bind Time1.04s (± 1.16%)1.04s (± 0.49%)-0.00s (- 0.00%)1.04s1.05s
Check Time19.09s (± 0.74%)19.00s (± 0.30%)-0.09s (- 0.46%)18.91s19.07s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time24.07s (± 0.67%)23.97s (± 0.30%)-0.10s (- 0.41%)23.86s24.05s
xstate - node (v14.15.1, x64)
Memory used534,443k (± 0.01%)534,504k (± 0.01%)+61k (+ 0.01%)534,406k534,565k
Parse Time5.17s (± 0.76%)5.19s (± 0.33%)+0.02s (+ 0.42%)5.16s5.21s
Bind Time1.72s (± 1.13%)1.74s (± 0.47%)+0.02s (+ 1.07%)1.73s1.75s
Check Time3.10s (± 0.67%)3.09s (± 0.49%)-0.00s (- 0.11%)3.07s3.11s
Emit Time0.10s (± 0.00%)0.10s (± 0.00%)0.00s ( 0.00%)0.10s0.10s
Total Time10.08s (± 0.41%)10.12s (± 0.18%)+0.04s (+ 0.38%)10.08s10.13s
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
Current524666
Baselinemain6

TSServer

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,519ms (± 1.71%)2,496ms (± 0.99%)-23ms (- 0.91%)2,469ms2,533ms
Req 2 - geterr5,499ms (± 0.31%)5,505ms (± 0.47%)+6ms (+ 0.11%)5,476ms5,541ms
Req 3 - references365ms (± 0.89%)366ms (± 0.46%)+1ms (+ 0.37%)364ms369ms
Req 4 - navto285ms (± 0.31%)283ms (± 0.85%)-2ms (- 0.58%)279ms286ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo67ms (± 3.53%)66ms (± 3.45%)-1ms (- 1.49%)64ms70ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,739ms (± 1.36%)2,769ms (± 1.22%)+30ms (+ 1.08%)2,727ms2,823ms
Req 2 - geterr4,050ms (± 0.67%)4,059ms (± 0.46%)+9ms (+ 0.23%)4,025ms4,082ms
Req 3 - references367ms (± 0.64%)369ms (± 0.61%)+2ms (+ 0.50%)367ms373ms
Req 4 - navto299ms (± 1.09%)299ms (± 0.54%)-0ms (- 0.11%)296ms300ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo82ms (± 1.09%)82ms (± 0.63%)+0ms (+ 0.41%)82ms83ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,487ms (± 0.42%)3,487ms (± 0.81%)+0ms (+ 0.01%)3,451ms3,515ms
Req 2 - geterr1,418ms (± 1.53%)1,417ms (± 0.93%)-1ms (- 0.04%)1,405ms1,436ms
Req 3 - references105ms (± 1.44%)104ms (± 1.12%)-1ms (- 0.48%)103ms106ms
Req 4 - navto357ms (± 0.42%)356ms (± 0.73%)-1ms (- 0.19%)353ms360ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo466ms (± 1.25%)470ms (± 1.44%)+4ms (+ 0.93%)462ms478ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,764ms (± 0.85%)2,770ms (± 0.70%)+6ms (+ 0.21%)2,746ms2,801ms
Req 2 - geterr5,885ms (± 0.21%)5,875ms (± 0.53%)-9ms (- 0.16%)5,826ms5,914ms
Req 3 - references377ms (± 1.29%)377ms (± 1.57%)+0ms (+ 0.09%)373ms389ms
Req 4 - navto278ms (± 0.97%)281ms (± 1.56%)+2ms (+ 0.84%)275ms286ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo73ms (± 3.92%)80ms (±10.38%)+6ms (+ 8.41%)69ms88ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,936ms (± 0.47%)2,923ms (± 0.30%)-14ms (- 0.46%)2,906ms2,930ms
Req 2 - geterr4,396ms (± 0.40%)4,397ms (± 0.45%)+1ms (+ 0.02%)4,364ms4,417ms
Req 3 - references379ms (± 1.15%)379ms (± 0.78%)-1ms (- 0.13%)375ms383ms
Req 4 - navto288ms (± 0.36%)287ms (± 0.71%)-1ms (- 0.23%)284ms290ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo72ms (± 1.05%)72ms (± 1.36%)+0ms (+ 0.46%)71ms74ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,629ms (± 0.54%)3,627ms (± 0.33%)-2ms (- 0.05%)3,610ms3,643ms
Req 2 - geterr1,564ms (± 1.09%)1,561ms (± 0.91%)-3ms (- 0.21%)1,550ms1,588ms
Req 3 - references110ms (± 0.96%)110ms (± 1.57%)+0ms (+ 0.30%)107ms112ms
Req 4 - navto342ms (± 1.03%)343ms (± 1.22%)+2ms (+ 0.54%)340ms350ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo478ms (± 0.68%)483ms (± 0.97%)+5ms (+ 1.12%)476ms489ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,901ms (± 0.37%)2,908ms (± 0.26%)+6ms (+ 0.22%)2,896ms2,919ms
Req 2 - geterr6,284ms (± 0.32%)6,289ms (± 0.50%)+5ms (+ 0.08%)6,255ms6,347ms
Req 3 - references391ms (± 0.55%)391ms (± 0.21%)0ms ( 0.00%)390ms392ms
Req 4 - navto284ms (± 1.61%)281ms (± 0.61%)-3ms (- 0.94%)279ms283ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo87ms (± 5.94%)86ms (± 5.95%)-2ms (- 1.72%)78ms92ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,094ms (± 1.33%)3,086ms (± 0.74%)-8ms (- 0.25%)3,058ms3,119ms
Req 2 - geterr4,703ms (± 0.47%)4,694ms (± 0.54%)-9ms (- 0.18%)4,651ms4,720ms
Req 3 - references404ms (± 1.28%)404ms (± 0.73%)-1ms (- 0.12%)400ms408ms
Req 4 - navto292ms (± 0.79%)294ms (± 1.14%)+2ms (+ 0.63%)291ms299ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo80ms (± 0.94%)81ms (± 4.09%)+1ms (+ 1.46%)79ms88ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,956ms (± 0.48%)3,981ms (± 0.53%)+25ms (+ 0.64%)3,956ms4,013ms
Req 2 - geterr1,543ms (± 1.69%)1,533ms (± 1.29%)-10ms (- 0.66%)1,512ms1,561ms
Req 3 - references133ms (± 0.88%)129ms (± 4.18%)🟩-4ms (- 3.13%)121ms136ms
Req 4 - navto372ms (± 0.50%)377ms (± 0.90%)+5ms (+ 1.35%)374ms383ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo508ms (± 1.43%)495ms (± 1.33%)-13ms (- 2.49%)487ms504ms
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
Current524666
Baselinemain6

Startup

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time141.87ms (± 0.22%)142.03ms (± 0.23%)+0.16ms (+ 0.11%)141.40ms148.14ms
tsserver-startup - node (v16.17.1, x64)
Execution time225.42ms (± 0.15%)225.52ms (± 0.14%)+0.10ms (+ 0.04%)224.65ms228.69ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time227.96ms (± 0.17%)228.02ms (± 0.13%)+0.06ms (+ 0.03%)227.16ms232.09ms
typescript-startup - node (v16.17.1, x64)
Execution time208.91ms (± 0.18%)209.03ms (± 0.17%)+0.12ms (+ 0.06%)208.25ms213.41ms
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
Current524666
Baselinemain6

Developer Information:

Download Benchmark

@sandersn

Copy link
Copy Markdown
MemberAuthor

Wesley Wigham (@weswigham) maybe you're right about the isTsserver check. The speedup is gone in the commit with the suspicious version of the check.

@sandersn

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 28, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the perf test suite on this PR at ebcbd11. You can monitor the build here.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used359,841k (± 0.02%)359,828k (± 0.02%)-14k (- 0.00%)359,770k359,920k
Parse Time3.96s (± 0.76%)3.97s (± 0.57%)+0.00s (+ 0.13%)3.94s3.99s
Bind Time1.17s (± 0.47%)1.17s (± 0.35%)-0.00s (- 0.28%)1.17s1.18s
Check Time8.64s (± 0.57%)8.63s (± 0.27%)-0.01s (- 0.08%)8.59s8.65s
Emit Time7.62s (± 0.59%)7.59s (± 0.48%)-0.03s (- 0.35%)7.53s7.63s
Total Time21.40s (± 0.34%)21.37s (± 0.19%)-0.03s (- 0.15%)21.32s21.44s
Compiler-Unions - node (v18.10.0, x64)
Memory used194,520k (± 1.51%)193,518k (± 1.22%)-1,002k (- 0.52%)192,459k198,334k
Parse Time1.64s (± 1.41%)1.63s (± 1.79%)-0.01s (- 0.61%)1.59s1.66s
Bind Time0.80s (± 0.69%)0.79s (± 0.52%)-0.00s (- 0.42%)0.79s0.80s
Check Time9.67s (± 0.96%)9.62s (± 1.07%)-0.04s (- 0.43%)9.50s9.77s
Emit Time2.81s (± 2.25%)2.80s (± 1.05%)-0.01s (- 0.36%)2.75s2.83s
Total Time14.92s (± 0.62%)14.85s (± 0.69%)-0.06s (- 0.44%)14.76s15.04s
Monaco - node (v18.10.0, x64)
Memory used343,959k (± 0.01%)344,011k (± 0.01%)+52k (+ 0.01%)343,927k344,065k
Parse Time2.96s (± 0.85%)2.96s (± 0.70%)+0.00s (+ 0.17%)2.95s3.00s
Bind Time1.04s (± 1.12%)1.04s (± 1.12%)-0.00s (- 0.32%)1.02s1.05s
Check Time7.05s (± 0.56%)7.05s (± 0.54%)+0.00s (+ 0.05%)7.00s7.11s
Emit Time4.32s (± 0.79%)4.34s (± 0.53%)+0.02s (+ 0.42%)4.31s4.36s
Total Time15.37s (± 0.23%)15.39s (± 0.31%)+0.02s (+ 0.15%)15.35s15.47s
TFS - node (v18.10.0, x64)
Memory used300,378k (± 0.00%)300,344k (± 0.01%)-34k (- 0.01%)300,303k300,376k
Parse Time2.27s (± 1.14%)2.25s (± 1.71%)-0.03s (- 1.32%)2.20s2.31s
Bind Time1.17s (± 0.00%)1.17s (± 0.00%)0.00s ( 0.00%)1.17s1.17s
Check Time6.55s (± 0.80%)6.50s (± 0.40%)-0.06s (- 0.89%)6.45s6.52s
Emit Time3.93s (± 0.82%)3.92s (± 0.78%)-0.01s (- 0.17%)3.88s3.96s
Total Time13.93s (± 0.72%)13.83s (± 0.21%)-0.10s (- 0.74%)13.78s13.86s
material-ui - node (v18.10.0, x64)
Memory used476,715k (± 0.00%)476,751k (± 0.02%)+36k (+ 0.01%)476,673k476,884k
Parse Time3.56s (± 0.63%)3.51s (± 2.06%)-0.05s (- 1.40%)3.42s3.57s
Bind Time0.97s (± 0.65%)1.01s (± 6.55%)+0.04s (+ 3.95%)0.96s1.12s
Check Time17.15s (± 0.80%)17.10s (± 0.70%)-0.05s (- 0.32%)16.95s17.26s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time21.68s (± 0.63%)21.62s (± 0.55%)-0.06s (- 0.30%)21.47s21.80s
xstate - node (v18.10.0, x64)
Memory used548,604k (± 0.01%)548,539k (± 0.01%)-66k (- 0.01%)548,468k548,661k
Parse Time4.56s (± 0.66%)4.57s (± 0.36%)+0.00s (+ 0.07%)4.55s4.59s
Bind Time1.71s (± 0.68%)1.71s (± 1.30%)-0.00s (- 0.19%)1.68s1.74s
Check Time2.73s (± 1.10%)2.74s (± 0.63%)+0.02s (+ 0.55%)2.72s2.77s
Emit Time0.08s (± 0.00%)0.09s (± 6.44%)+0.01s (+ 6.25%)0.08s0.09s
Total Time9.09s (± 0.38%)9.12s (± 0.43%)+0.02s (+ 0.22%)9.07s9.17s
Angular - node (v16.17.1, x64)
Memory used359,216k (± 0.01%)359,224k (± 0.01%)+8k (+ 0.00%)359,200k359,265k
Parse Time4.19s (± 0.41%)4.19s (± 0.18%)0.00s ( 0.00%)4.18s4.20s
Bind Time1.22s (± 0.84%)1.22s (± 0.81%)-0.01s (- 0.41%)1.21s1.23s
Check Time9.39s (± 0.41%)9.40s (± 0.20%)+0.02s (+ 0.16%)9.38s9.43s
Emit Time8.07s (± 0.71%)8.07s (± 0.42%)0.00s ( 0.00%)8.03s8.11s
Total Time22.87s (± 0.40%)22.89s (± 0.26%)+0.01s (+ 0.06%)22.82s22.97s
Compiler-Unions - node (v16.17.1, x64)
Memory used194,849k (± 0.76%)194,219k (± 0.05%)-630k (- 0.32%)194,108k194,354k
Parse Time1.80s (± 0.57%)1.79s (± 0.91%)-0.01s (- 0.56%)1.76s1.81s
Bind Time0.84s (± 1.17%)0.84s (± 0.65%)+0.01s (+ 0.80%)0.84s0.85s
Check Time10.36s (± 0.49%)10.30s (± 0.27%)-0.06s (- 0.58%)10.26s10.33s
Emit Time3.05s (± 0.87%)3.06s (± 0.78%)+0.01s (+ 0.49%)3.04s3.10s
Total Time16.05s (± 0.36%)16.00s (± 0.18%)-0.05s (- 0.33%)15.96s16.03s
Monaco - node (v16.17.1, x64)
Memory used343,253k (± 0.01%)343,290k (± 0.01%)+37k (+ 0.01%)343,258k343,332k
Parse Time3.18s (± 1.01%)3.15s (± 1.18%)-0.02s (- 0.63%)3.11s3.21s
Bind Time1.11s (± 0.95%)1.11s (± 1.23%)+0.01s (+ 0.90%)1.10s1.14s
Check Time7.74s (± 0.48%)7.72s (± 0.66%)-0.02s (- 0.24%)7.67s7.82s
Emit Time4.52s (± 0.74%)4.53s (± 0.77%)+0.01s (+ 0.18%)4.51s4.60s
Total Time16.55s (± 0.38%)16.53s (± 0.32%)-0.02s (- 0.14%)16.46s16.62s
TFS - node (v16.17.1, x64)
Memory used299,756k (± 0.00%)299,750k (± 0.00%)-6k (- 0.00%)299,738k299,771k
Parse Time2.47s (± 1.53%)2.44s (± 0.84%)-0.03s (- 1.28%)2.42s2.47s
Bind Time1.25s (± 0.60%)1.25s (± 0.82%)+0.00s (+ 0.13%)1.24s1.27s
Check Time7.18s (± 0.44%)7.19s (± 0.50%)+0.00s (+ 0.02%)7.17s7.26s
Emit Time4.24s (± 0.86%)4.22s (± 0.83%)-0.02s (- 0.59%)4.18s4.28s
Total Time15.15s (± 0.33%)15.10s (± 0.48%)-0.05s (- 0.34%)15.03s15.23s
material-ui - node (v16.17.1, x64)
Memory used476,064k (± 0.02%)476,101k (± 0.02%)+37k (+ 0.01%)475,986k476,216k
Parse Time3.71s (± 0.22%)3.72s (± 0.34%)+0.01s (+ 0.13%)3.70s3.73s
Bind Time1.02s (± 0.80%)1.02s (± 0.00%)-0.00s (- 0.33%)1.02s1.02s
Check Time18.16s (± 0.46%)18.07s (± 0.48%)-0.09s (- 0.52%)17.98s18.21s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.90s (± 0.38%)22.81s (± 0.34%)-0.09s (- 0.41%)22.72s22.93s
xstate - node (v16.17.1, x64)
Memory used546,223k (± 0.02%)546,250k (± 0.01%)+27k (+ 0.01%)546,196k546,406k
Parse Time4.77s (± 0.28%)4.76s (± 0.32%)-0.01s (- 0.24%)4.74s4.78s
Bind Time1.83s (± 0.75%)1.81s (± 3.79%)-0.03s (- 1.36%)1.67s1.84s
Check Time2.97s (± 0.46%)3.00s (± 2.53%)+0.04s (+ 1.29%)2.97s3.16s
Emit Time0.10s (± 5.76%)0.09s (± 5.53%)-0.00s (- 1.75%)0.09s0.10s
Total Time9.67s (± 0.17%)9.66s (± 0.19%)-0.00s (- 0.03%)9.64s9.69s
Angular - node (v14.15.1, x64)
Memory used352,853k (± 0.00%)352,849k (± 0.01%)-4k (- 0.00%)352,826k352,887k
Parse Time4.24s (± 0.58%)4.24s (± 0.57%)-0.00s (- 0.12%)4.21s4.28s
Bind Time1.29s (± 0.63%)1.28s (± 0.59%)-0.01s (- 0.39%)1.27s1.29s
Check Time9.72s (± 0.38%)9.70s (± 0.43%)-0.02s (- 0.21%)9.63s9.75s
Emit Time8.40s (± 0.73%)8.37s (± 0.39%)-0.03s (- 0.38%)8.33s8.42s
Total Time23.64s (± 0.38%)23.59s (± 0.23%)-0.06s (- 0.24%)23.51s23.67s
Compiler-Unions - node (v14.15.1, x64)
Memory used190,178k (± 0.87%)189,149k (± 0.06%)-1,029k (- 0.54%)189,063k189,384k
Parse Time1.84s (± 0.49%)1.84s (± 0.66%)+0.00s (+ 0.18%)1.82s1.85s
Bind Time0.86s (± 0.73%)0.86s (± 0.47%)+0.00s (+ 0.19%)0.86s0.87s
Check Time10.37s (± 0.59%)10.39s (± 0.77%)+0.02s (+ 0.18%)10.31s10.49s
Emit Time3.46s (± 1.15%)3.40s (± 3.73%)-0.06s (- 1.78%)3.15s3.50s
Total Time16.54s (± 0.63%)16.50s (± 0.51%)-0.04s (- 0.24%)16.35s16.61s
Monaco - node (v14.15.1, x64)
Memory used338,019k (± 0.01%)338,038k (± 0.00%)+19k (+ 0.01%)338,023k338,047k
Parse Time3.22s (± 1.09%)3.28s (± 1.24%)+0.06s (+ 1.81%)3.23s3.34s
Bind Time1.11s (± 0.68%)1.11s (± 0.00%)+0.00s (+ 0.15%)1.11s1.11s
Check Time8.05s (± 0.26%)8.06s (± 0.45%)+0.01s (+ 0.06%)8.01s8.10s
Emit Time4.76s (± 0.39%)4.75s (± 0.49%)-0.01s (- 0.21%)4.72s4.79s
Total Time17.14s (± 0.26%)17.20s (± 0.19%)+0.05s (+ 0.30%)17.14s17.23s
TFS - node (v14.15.1, x64)
Memory used294,588k (± 0.01%)294,609k (± 0.01%)+21k (+ 0.01%)294,594k294,632k
Parse Time2.74s (± 0.72%)2.74s (± 0.55%)-0.00s (- 0.06%)2.73s2.77s
Bind Time1.11s (± 0.37%)1.10s (± 0.74%)-0.01s (- 0.75%)1.09s1.11s
Check Time7.50s (± 0.66%)7.51s (± 0.37%)+0.01s (+ 0.11%)7.47s7.55s
Emit Time4.60s (± 0.58%)4.61s (± 0.93%)+0.01s (+ 0.18%)4.58s4.69s
Total Time15.96s (± 0.36%)15.96s (± 0.33%)-0.00s (- 0.03%)15.91s16.04s
material-ui - node (v14.15.1, x64)
Memory used471,562k (± 0.00%)471,566k (± 0.00%)+4k (+ 0.00%)471,534k471,595k
Parse Time3.93s (± 0.71%)3.93s (± 0.62%)-0.01s (- 0.17%)3.90s3.97s
Bind Time1.04s (± 1.16%)1.05s (± 0.49%)+0.00s (+ 0.32%)1.04s1.05s
Check Time19.09s (± 0.74%)19.03s (± 0.45%)-0.06s (- 0.31%)18.92s19.14s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time24.07s (± 0.67%)24.01s (± 0.32%)-0.06s (- 0.24%)23.90s24.09s
xstate - node (v14.15.1, x64)
Memory used534,443k (± 0.01%)534,473k (± 0.00%)+31k (+ 0.01%)534,441k534,495k
Parse Time5.17s (± 0.76%)5.15s (± 0.81%)-0.02s (- 0.32%)5.11s5.22s
Bind Time1.72s (± 1.13%)1.72s (± 1.16%)+0.00s (+ 0.10%)1.70s1.75s
Check Time3.10s (± 0.67%)3.09s (± 0.35%)-0.01s (- 0.22%)3.08s3.10s
Emit Time0.10s (± 0.00%)0.10s (± 0.00%)0.00s ( 0.00%)0.10s0.10s
Total Time10.08s (± 0.41%)10.06s (± 0.49%)-0.02s (- 0.17%)10.02s10.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
Current524666
Baselinemain6

TSServer

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,519ms (± 1.71%)2,498ms (± 1.26%)-21ms (- 0.82%)2,461ms2,533ms
Req 2 - geterr5,499ms (± 0.31%)5,506ms (± 0.20%)+7ms (+ 0.13%)5,490ms5,517ms
Req 3 - references365ms (± 0.89%)365ms (± 1.17%)-0ms (- 0.05%)356ms368ms
Req 4 - navto285ms (± 0.31%)285ms (± 0.26%)-0ms (- 0.06%)284ms286ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo67ms (± 3.53%)68ms (± 4.10%)+1ms (+ 1.24%)65ms71ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,739ms (± 1.36%)2,755ms (± 1.06%)+16ms (+ 0.57%)2,715ms2,794ms
Req 2 - geterr4,050ms (± 0.67%)4,055ms (± 0.23%)+6ms (+ 0.14%)4,047ms4,073ms
Req 3 - references367ms (± 0.64%)368ms (± 0.58%)+2ms (+ 0.41%)366ms372ms
Req 4 - navto299ms (± 1.09%)299ms (± 0.66%)-1ms (- 0.22%)295ms300ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo82ms (± 1.09%)82ms (± 3.52%)-0ms (- 0.41%)76ms84ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,487ms (± 0.42%)3,485ms (± 0.48%)-3ms (- 0.07%)3,457ms3,505ms
Req 2 - geterr1,418ms (± 1.53%)1,427ms (± 1.49%)+10ms (+ 0.69%)1,395ms1,460ms
Req 3 - references105ms (± 1.44%)103ms (± 1.29%)-2ms (- 1.43%)101ms105ms
Req 4 - navto357ms (± 0.42%)355ms (± 0.87%)-2ms (- 0.47%)351ms360ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo466ms (± 1.25%)464ms (± 2.09%)-2ms (- 0.36%)455ms476ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,764ms (± 0.85%)2,782ms (± 0.51%)+18ms (+ 0.65%)2,764ms2,804ms
Req 2 - geterr5,885ms (± 0.21%)5,870ms (± 0.43%)-15ms (- 0.25%)5,842ms5,910ms
Req 3 - references377ms (± 1.29%)373ms (± 1.62%)-4ms (- 1.02%)369ms385ms
Req 4 - navto278ms (± 0.97%)279ms (± 0.42%)+1ms (+ 0.24%)277ms280ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo73ms (± 3.92%)77ms (± 3.58%)+3ms (+ 4.32%)71ms78ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,936ms (± 0.47%)2,927ms (± 0.21%)-10ms (- 0.32%)2,917ms2,935ms
Req 2 - geterr4,396ms (± 0.40%)4,395ms (± 0.39%)-1ms (- 0.02%)4,375ms4,417ms
Req 3 - references379ms (± 1.15%)380ms (± 0.52%)+1ms (+ 0.35%)378ms383ms
Req 4 - navto288ms (± 0.36%)286ms (± 0.46%)-1ms (- 0.46%)284ms287ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo72ms (± 1.05%)72ms (± 1.63%)0ms ( 0.00%)71ms74ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,629ms (± 0.54%)3,621ms (± 0.30%)-8ms (- 0.21%)3,601ms3,633ms
Req 2 - geterr1,564ms (± 1.09%)1,562ms (± 0.93%)-2ms (- 0.12%)1,538ms1,580ms
Req 3 - references110ms (± 0.96%)111ms (± 2.04%)+1ms (+ 0.91%)108ms114ms
Req 4 - navto342ms (± 1.03%)341ms (± 0.78%)-0ms (- 0.05%)338ms346ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo478ms (± 0.68%)480ms (± 1.43%)+2ms (+ 0.45%)469ms490ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,901ms (± 0.37%)2,912ms (± 0.44%)+11ms (+ 0.37%)2,898ms2,931ms
Req 2 - geterr6,284ms (± 0.32%)6,272ms (± 0.80%)-12ms (- 0.19%)6,201ms6,339ms
Req 3 - references391ms (± 0.55%)389ms (± 0.19%)-2ms (- 0.38%)388ms390ms
Req 4 - navto284ms (± 1.61%)283ms (± 1.59%)-1ms (- 0.47%)277ms288ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo87ms (± 5.94%)88ms (± 9.14%)+1ms (+ 0.96%)72ms93ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,094ms (± 1.33%)3,079ms (± 0.22%)-15ms (- 0.49%)3,072ms3,087ms
Req 2 - geterr4,703ms (± 0.47%)4,692ms (± 0.39%)-11ms (- 0.23%)4,673ms4,726ms
Req 3 - references404ms (± 1.28%)405ms (± 0.92%)+1ms (+ 0.21%)401ms411ms
Req 4 - navto292ms (± 0.79%)291ms (± 0.81%)-2ms (- 0.57%)288ms294ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo80ms (± 0.94%)82ms (± 3.61%)+2ms (+ 2.29%)80ms88ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,956ms (± 0.48%)3,967ms (± 0.74%)+12ms (+ 0.29%)3,938ms4,015ms
Req 2 - geterr1,543ms (± 1.69%)1,524ms (± 1.66%)-20ms (- 1.26%)1,487ms1,559ms
Req 3 - references133ms (± 0.88%)130ms (± 3.32%)-3ms (- 2.50%)123ms135ms
Req 4 - navto372ms (± 0.50%)373ms (± 0.55%)+2ms (+ 0.49%)370ms376ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo508ms (± 1.43%)500ms (± 2.50%)-8ms (- 1.64%)484ms513ms
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
Current524666
Baselinemain6

Startup

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time141.87ms (± 0.22%)142.01ms (± 0.16%)+0.14ms (+ 0.10%)141.45ms144.37ms
tsserver-startup - node (v16.17.1, x64)
Execution time225.42ms (± 0.15%)225.73ms (± 0.17%)+0.30ms (+ 0.13%)224.85ms232.10ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time227.96ms (± 0.17%)228.27ms (± 0.21%)+0.31ms (+ 0.14%)227.22ms241.12ms
typescript-startup - node (v16.17.1, x64)
Execution time208.91ms (± 0.18%)209.27ms (± 0.16%)+0.36ms (+ 0.17%)208.45ms213.55ms
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
Current524666
Baselinemain6

Developer Information:

Download Benchmark

1. Set a global boolean when invoked from tsc.
2. Use a regex with sourceText.slice to check for @see/@link.
@sandersn

Nathan Shively-Sanders (sandersn) commented Feb 1, 2023

Copy link
Copy Markdown
MemberAuthor

The latest commit is something we could merge, I think. However, the check for @see/@link is unfortunately expensive.
(Edit: The check doesn't reduce the amount of memory savings, however.)

TypeScript Bot (@typescript-bot) perf test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Feb 1, 2023

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@sandersn), I've started to run the perf test suite on this PR at 2842d0c. You can monitor the build here.

Update: The results are in!

Comment threadsrc/compiler/parser.ts Outdated

const seeLink = /@(?:see|link)/;
function shouldParseJSDoc<T extends HasJSDoc>(node: T, comment: ts.CommentRange) {
if (!(globalThis as any).isTSC) return true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a way to do this without smuggling in the boolean? How can we test that we don't break tsc?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I mean, rather than a global context flag, best is probably to pass an option down into the parser from whatever's constructing the program, right? This way API consumers can intelligently select if they need to skip jsdoc or not.

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used359,817k (± 0.01%)351,129k (± 0.01%)-8,688k (- 2.41%)351,108k351,169k
Parse Time3.97s (± 1.02%)3.64s (± 1.04%)🟩-0.33s (- 8.24%)3.57s3.68s
Bind Time1.18s (± 1.29%)1.16s (± 0.72%)-0.02s (- 1.70%)1.15s1.17s
Check Time8.64s (± 0.54%)8.65s (± 0.69%)+0.01s (+ 0.10%)8.58s8.75s
Emit Time7.65s (± 0.70%)7.81s (± 1.05%)+0.16s (+ 2.14%)7.75s7.95s
Total Time21.43s (± 0.59%)21.26s (± 0.43%)-0.17s (- 0.80%)21.12s21.37s
Compiler-Unions - node (v18.10.0, x64)
Memory used192,558k (± 0.02%)192,564k (± 1.54%)+6k (+ 0.00%)190,601k196,437k
Parse Time1.66s (± 1.51%)1.49s (± 3.15%)🟩-0.17s (-10.36%)1.43s1.54s
Bind Time0.80s (± 0.51%)0.81s (± 1.01%)+0.01s (+ 0.62%)0.80s0.82s
Check Time9.71s (± 0.67%)9.68s (± 0.72%)-0.03s (- 0.33%)9.60s9.79s
Emit Time2.84s (± 1.66%)2.80s (± 0.50%)-0.04s (- 1.35%)2.78s2.82s
Total Time15.01s (± 0.67%)14.78s (± 0.66%)-0.23s (- 1.55%)14.67s14.96s
Monaco - node (v18.10.0, x64)
Memory used343,985k (± 0.02%)342,734k (± 0.01%)-1,251k (- 0.36%)342,697k342,758k
Parse Time2.97s (± 1.65%)2.90s (± 0.34%)-0.06s (- 2.19%)2.89s2.92s
Bind Time1.04s (± 0.72%)1.05s (± 0.72%)+0.01s (+ 1.28%)1.04s1.06s
Check Time7.07s (± 0.58%)7.05s (± 0.55%)-0.03s (- 0.35%)7.01s7.12s
Emit Time4.32s (± 0.64%)4.37s (± 0.57%)+0.04s (+ 1.00%)4.34s4.40s
Total Time15.40s (± 0.43%)15.37s (± 0.39%)-0.03s (- 0.23%)15.30s15.45s
TFS - node (v18.10.0, x64)
Memory used300,390k (± 0.00%)300,490k (± 0.01%)+100k (+ 0.03%)300,465k300,518k
Parse Time2.26s (± 1.00%)2.29s (± 1.20%)+0.03s (+ 1.48%)2.25s2.33s
Bind Time1.17s (± 0.54%)1.15s (± 0.48%)-0.02s (- 2.14%)1.14s1.15s
Check Time6.56s (± 0.80%)6.55s (± 0.39%)-0.01s (- 0.15%)6.52s6.59s
Emit Time3.94s (± 1.26%)3.95s (± 0.76%)+0.01s (+ 0.17%)3.90s3.99s
Total Time13.92s (± 0.67%)13.93s (± 0.27%)+0.01s (+ 0.04%)13.89s13.99s
material-ui - node (v18.10.0, x64)
Memory used476,773k (± 0.01%)468,878k (± 0.00%)-7,895k (- 1.66%)468,855k468,896k
Parse Time3.54s (± 0.61%)3.15s (± 0.74%)🟩-0.39s (-11.01%)3.12s3.19s
Bind Time0.97s (± 0.42%)1.12s (± 0.88%)+0.15s (+15.83%)1.11s1.13s
Check Time17.18s (± 0.92%)17.26s (± 1.11%)+0.08s (+ 0.45%)16.91s17.45s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time21.69s (± 0.70%)21.53s (± 0.85%)-0.16s (- 0.75%)21.20s21.73s
xstate - node (v18.10.0, x64)
Memory used548,585k (± 0.02%)521,287k (± 0.02%)🟩-27,298k (- 4.98%)521,138k521,371k
Parse Time4.57s (± 0.46%)4.12s (± 0.59%)🟩-0.45s (- 9.77%)4.08s4.15s
Bind Time1.72s (± 1.26%)1.77s (± 0.68%)+0.05s (+ 2.91%)1.75s1.78s
Check Time2.74s (± 0.98%)2.74s (± 1.12%)+0.00s (+ 0.12%)2.70s2.77s
Emit Time0.09s (± 5.95%)0.08s (± 4.99%)🟩-0.01s (- 5.77%)0.08s0.09s
Total Time9.12s (± 0.34%)8.72s (± 0.61%)🟩-0.40s (- 4.42%)8.64s8.78s
Angular - node (v16.17.1, x64)
Memory used359,219k (± 0.01%)350,465k (± 0.00%)-8,754k (- 2.44%)350,438k350,479k
Parse Time4.19s (± 0.28%)3.81s (± 0.58%)🟩-0.38s (- 8.99%)3.78s3.83s
Bind Time1.23s (± 0.61%)1.20s (± 0.00%)-0.03s (- 2.31%)1.20s1.20s
Check Time9.41s (± 0.54%)9.45s (± 0.44%)+0.04s (+ 0.44%)9.37s9.48s
Emit Time8.07s (± 0.49%)8.28s (± 0.28%)+0.21s (+ 2.60%)8.25s8.31s
Total Time22.90s (± 0.40%)22.75s (± 0.13%)-0.15s (- 0.67%)22.72s22.80s
Compiler-Unions - node (v16.17.1, x64)
Memory used194,223k (± 0.05%)192,806k (± 0.67%)-1,417k (- 0.73%)192,249k195,455k
Parse Time1.81s (± 0.57%)1.67s (± 1.03%)🟩-0.14s (- 7.66%)1.64s1.69s
Bind Time0.85s (± 0.65%)0.85s (± 0.60%)+0.01s (+ 0.99%)0.85s0.86s
Check Time10.38s (± 0.47%)10.30s (± 0.75%)-0.08s (- 0.80%)10.20s10.40s
Emit Time3.09s (± 0.88%)3.12s (± 3.65%)+0.03s (+ 0.92%)3.04s3.34s
Total Time16.13s (± 0.37%)15.94s (± 1.06%)-0.19s (- 1.17%)15.77s16.26s
Monaco - node (v16.17.1, x64)
Memory used343,238k (± 0.01%)342,027k (± 0.01%)-1,211k (- 0.35%)341,985k342,074k
Parse Time3.16s (± 0.89%)3.08s (± 0.92%)-0.08s (- 2.63%)3.04s3.11s
Bind Time1.12s (± 0.49%)1.13s (± 0.36%)+0.01s (+ 1.20%)1.12s1.13s
Check Time7.73s (± 0.15%)7.69s (± 0.38%)-0.04s (- 0.52%)7.66s7.73s
Emit Time4.54s (± 0.55%)4.55s (± 1.03%)+0.01s (+ 0.18%)4.50s4.63s
Total Time16.55s (± 0.25%)16.44s (± 0.37%)-0.11s (- 0.63%)16.34s16.50s
TFS - node (v16.17.1, x64)
Memory used299,779k (± 0.01%)299,862k (± 0.01%)+83k (+ 0.03%)299,843k299,884k
Parse Time2.48s (± 0.66%)2.52s (± 0.74%)+0.04s (+ 1.61%)2.50s2.55s
Bind Time1.25s (± 0.44%)1.24s (± 0.61%)-0.01s (- 1.06%)1.23s1.25s
Check Time7.20s (± 0.39%)7.23s (± 0.48%)+0.03s (+ 0.37%)7.18s7.27s
Emit Time4.23s (± 0.69%)4.25s (± 0.99%)+0.03s (+ 0.59%)4.21s4.30s
Total Time15.17s (± 0.27%)15.24s (± 0.54%)+0.07s (+ 0.45%)15.14s15.35s
material-ui - node (v16.17.1, x64)
Memory used476,053k (± 0.01%)468,188k (± 0.01%)-7,865k (- 1.65%)468,144k468,282k
Parse Time3.72s (± 0.26%)3.25s (± 0.51%)🟩-0.47s (-12.67%)3.23s3.27s
Bind Time1.02s (± 0.40%)1.18s (± 1.07%)+0.16s (+15.50%)1.16s1.19s
Check Time18.14s (± 0.22%)18.14s (± 0.55%)-0.01s (- 0.05%)18.06s18.33s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.89s (± 0.22%)22.56s (± 0.47%)-0.32s (- 1.41%)22.48s22.76s
xstate - node (v16.17.1, x64)
Memory used546,259k (± 0.02%)518,677k (± 0.02%)🟩-27,582k (- 5.05%)518,559k518,806k
Parse Time4.77s (± 0.45%)4.28s (± 0.23%)🟩-0.49s (-10.34%)4.27s4.29s
Bind Time1.81s (± 4.31%)1.83s (± 0.28%)+0.02s (+ 1.38%)1.83s1.84s
Check Time3.00s (± 2.59%)2.95s (± 0.41%)-0.05s (- 1.66%)2.94s2.97s
Emit Time0.10s (± 4.15%)0.09s (± 0.00%)🟩-0.01s (- 8.47%)0.09s0.09s
Total Time9.68s (± 0.30%)9.16s (± 0.21%)🟩-0.52s (- 5.34%)9.13s9.18s
Angular - node (v14.15.1, x64)
Memory used352,835k (± 0.01%)344,175k (± 0.01%)-8,661k (- 2.45%)344,121k344,230k
Parse Time4.25s (± 0.53%)4.00s (± 0.80%)🟩-0.25s (- 6.00%)3.97s4.06s
Bind Time1.29s (± 0.63%)1.26s (± 0.41%)-0.03s (- 2.32%)1.26s1.27s
Check Time9.73s (± 0.54%)9.66s (± 0.51%)-0.07s (- 0.75%)9.59s9.73s
Emit Time8.38s (± 0.60%)8.56s (± 0.63%)+0.18s (+ 2.19%)8.52s8.64s
Total Time23.65s (± 0.34%)23.48s (± 0.45%)-0.17s (- 0.73%)23.36s23.62s
Compiler-Unions - node (v14.15.1, x64)
Memory used189,651k (± 0.68%)187,520k (± 0.06%)-2,131k (- 1.12%)187,290k187,599k
Parse Time1.84s (± 0.56%)1.70s (± 0.48%)🟩-0.15s (- 7.96%)1.68s1.70s
Bind Time0.86s (± 0.87%)0.87s (± 0.94%)+0.00s (+ 0.58%)0.86s0.88s
Check Time10.37s (± 0.34%)10.35s (± 0.48%)-0.02s (- 0.23%)10.30s10.43s
Emit Time3.40s (± 5.02%)3.21s (± 4.44%)🟩-0.19s (- 5.58%)3.10s3.50s
Total Time16.48s (± 0.87%)16.12s (± 0.91%)-0.36s (- 2.16%)15.97s16.38s
Monaco - node (v14.15.1, x64)
Memory used338,032k (± 0.00%)336,948k (± 0.00%)-1,084k (- 0.32%)336,929k336,964k
Parse Time3.24s (± 1.20%)3.19s (± 0.84%)-0.05s (- 1.60%)3.15s3.23s
Bind Time1.12s (± 0.49%)1.12s (± 0.98%)+0.00s (+ 0.45%)1.11s1.13s
Check Time8.05s (± 0.41%)8.07s (± 0.42%)+0.02s (+ 0.27%)8.01s8.10s
Emit Time4.78s (± 0.70%)4.78s (± 0.24%)-0.00s (- 0.03%)4.77s4.80s
Total Time17.18s (± 0.31%)17.15s (± 0.23%)-0.03s (- 0.16%)17.11s17.22s
TFS - node (v14.15.1, x64)
Memory used294,545k (± 0.01%)294,791k (± 0.00%)+245k (+ 0.08%)294,772k294,804k
Parse Time2.75s (± 1.11%)2.71s (± 1.06%)-0.04s (- 1.64%)2.67s2.73s
Bind Time1.12s (± 0.88%)1.09s (± 0.75%)-0.03s (- 2.83%)1.08s1.10s
Check Time7.51s (± 0.46%)7.50s (± 0.43%)-0.02s (- 0.22%)7.45s7.53s
Emit Time4.62s (± 0.85%)4.63s (± 0.77%)+0.01s (+ 0.29%)4.60s4.70s
Total Time16.00s (± 0.45%)15.92s (± 0.38%)-0.09s (- 0.54%)15.81s15.97s
material-ui - node (v14.15.1, x64)
Memory used471,563k (± 0.00%)463,933k (± 0.00%)-7,630k (- 1.62%)463,915k463,950k
Parse Time3.94s (± 0.72%)3.59s (± 0.34%)🟩-0.36s (- 9.05%)3.57s3.60s
Bind Time1.05s (± 0.72%)1.03s (± 0.61%)-0.02s (- 2.06%)1.02s1.04s
Check Time19.08s (± 0.51%)18.47s (± 0.31%)🟩-0.61s (- 3.20%)18.39s18.55s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time24.08s (± 0.43%)23.08s (± 0.26%)🟩-1.00s (- 4.13%)22.99s23.15s
xstate - node (v14.15.1, x64)
Memory used534,463k (± 0.01%)507,046k (± 0.01%)🟩-27,416k (- 5.13%)506,998k507,192k
Parse Time5.16s (± 0.89%)4.60s (± 0.75%)🟩-0.57s (-11.01%)4.55s4.63s
Bind Time1.71s (± 0.57%)1.91s (± 0.55%)+0.20s (+11.51%)1.89s1.92s
Check Time3.10s (± 0.57%)3.10s (± 0.38%)+0.00s (+ 0.11%)3.08s3.11s
Emit Time0.10s (± 0.00%)0.10s (± 0.00%)0.00s ( 0.00%)0.10s0.10s
Total Time10.07s (± 0.45%)9.71s (± 0.33%)🟩-0.36s (- 3.58%)9.67s9.76s
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
Current524666
Baselinemain6

TSServer

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,528ms (± 1.03%)2,498ms (± 0.81%)-30ms (- 1.19%)2,473ms2,525ms
Req 2 - geterr5,529ms (± 0.56%)5,520ms (± 1.04%)-8ms (- 0.15%)5,437ms5,584ms
Req 3 - references365ms (± 0.99%)363ms (± 1.28%)-3ms (- 0.68%)354ms367ms
Req 4 - navto286ms (± 0.29%)285ms (± 0.38%)-1ms (- 0.23%)284ms287ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo68ms (± 3.89%)68ms (± 3.54%)-1ms (- 0.73%)65ms70ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,714ms (± 0.55%)2,764ms (± 1.48%)+50ms (+ 1.83%)2,712ms2,802ms
Req 2 - geterr4,067ms (± 0.55%)4,077ms (± 0.45%)+11ms (+ 0.27%)4,043ms4,092ms
Req 3 - references369ms (± 0.90%)368ms (± 0.60%)-1ms (- 0.32%)364ms370ms
Req 4 - navto299ms (± 0.88%)300ms (± 0.62%)+1ms (+ 0.17%)298ms303ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo83ms (± 0.91%)81ms (± 2.76%)-2ms (- 1.81%)77ms83ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,479ms (± 0.78%)3,522ms (± 0.95%)+43ms (+ 1.24%)3,481ms3,579ms
Req 2 - geterr1,425ms (± 1.26%)1,420ms (± 0.71%)-4ms (- 0.30%)1,411ms1,438ms
Req 3 - references104ms (± 1.88%)104ms (± 1.41%)-0ms (- 0.16%)103ms106ms
Req 4 - navto355ms (± 0.65%)360ms (± 1.09%)+5ms (+ 1.50%)355ms367ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo465ms (± 1.62%)470ms (± 1.50%)+5ms (+ 1.11%)458ms477ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,786ms (± 0.44%)2,777ms (± 0.71%)-9ms (- 0.31%)2,754ms2,804ms
Req 2 - geterr5,884ms (± 0.54%)5,891ms (± 0.68%)+7ms (+ 0.11%)5,858ms5,965ms
Req 3 - references380ms (± 1.40%)379ms (± 1.80%)-1ms (- 0.26%)369ms389ms
Req 4 - navto279ms (± 0.49%)279ms (± 0.83%)+1ms (+ 0.24%)275ms281ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo72ms (± 3.51%)80ms (± 8.69%)+8ms (+11.11%)70ms88ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,933ms (± 0.63%)2,923ms (± 0.47%)-10ms (- 0.34%)2,905ms2,941ms
Req 2 - geterr4,400ms (± 0.50%)4,408ms (± 0.37%)+8ms (+ 0.19%)4,388ms4,425ms
Req 3 - references381ms (± 0.93%)378ms (± 0.43%)-3ms (- 0.83%)375ms380ms
Req 4 - navto288ms (± 0.61%)288ms (± 1.06%)+1ms (+ 0.23%)283ms291ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo71ms (± 1.14%)72ms (± 0.88%)+1ms (+ 0.93%)71ms73ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,640ms (± 0.70%)3,639ms (± 0.36%)-1ms (- 0.03%)3,625ms3,658ms
Req 2 - geterr1,568ms (± 0.92%)1,566ms (± 0.99%)-2ms (- 0.14%)1,548ms1,590ms
Req 3 - references110ms (± 1.56%)111ms (± 2.09%)+1ms (+ 0.61%)108ms114ms
Req 4 - navto343ms (± 1.75%)341ms (± 0.89%)-2ms (- 0.44%)339ms347ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo481ms (± 1.21%)483ms (± 1.58%)+1ms (+ 0.24%)469ms490ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,917ms (± 0.51%)2,921ms (± 0.47%)+4ms (+ 0.12%)2,900ms2,936ms
Req 2 - geterr6,265ms (± 0.69%)6,290ms (± 0.65%)+25ms (+ 0.39%)6,254ms6,350ms
Req 3 - references390ms (± 0.95%)390ms (± 0.21%)0ms ( 0.00%)390ms392ms
Req 4 - navto282ms (± 1.41%)284ms (± 0.99%)+2ms (+ 0.83%)281ms288ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo87ms (± 9.38%)87ms (± 7.33%)-0ms (- 0.19%)74ms92ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,086ms (± 1.23%)3,085ms (± 0.32%)-1ms (- 0.02%)3,070ms3,095ms
Req 2 - geterr4,693ms (± 0.49%)4,702ms (± 0.42%)+9ms (+ 0.19%)4,671ms4,731ms
Req 3 - references404ms (± 1.34%)404ms (± 0.76%)-1ms (- 0.16%)399ms407ms
Req 4 - navto292ms (± 0.72%)293ms (± 0.80%)+1ms (+ 0.17%)291ms297ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo82ms (± 3.61%)81ms (± 1.04%)-2ms (- 1.83%)79ms81ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,988ms (± 0.41%)4,007ms (± 0.58%)+19ms (+ 0.48%)3,972ms4,029ms
Req 2 - geterr1,549ms (± 1.28%)1,526ms (± 0.98%)-23ms (- 1.46%)1,512ms1,550ms
Req 3 - references132ms (± 2.26%)134ms (± 2.18%)+2ms (+ 1.26%)129ms137ms
Req 4 - navto377ms (± 0.52%)376ms (± 0.83%)-1ms (- 0.13%)370ms378ms
Req 5 - completionInfo count3,175 (± 0.00%)3,175 (± 0.00%)0 ( 0.00%)3,1753,175
Req 5 - completionInfo509ms (± 1.09%)504ms (± 0.61%)-5ms (- 0.88%)500ms509ms
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
Current524666
Baselinemain6

Startup

Comparison Report - main..52466
Metricmain52466DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time142.21ms (± 0.20%)142.96ms (± 0.22%)+0.74ms (+ 0.52%)141.98ms146.99ms
tsserver-startup - node (v16.17.1, x64)
Execution time226.41ms (± 0.19%)227.02ms (± 0.32%)+0.61ms (+ 0.27%)225.20ms233.62ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time228.88ms (± 0.20%)229.53ms (± 0.31%)+0.65ms (+ 0.28%)227.66ms239.22ms
typescript-startup - node (v16.17.1, x64)
Execution time209.54ms (± 0.20%)210.70ms (± 0.33%)+1.16ms (+ 0.55%)208.74ms215.18ms
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
Current524666
Baselinemain6

Developer Information:

Download Benchmark

@jakebailey

Copy link
Copy Markdown
Member

Is emit time getting better because we're no longer correctly emitting jsdoc from the sources?

function addJSDocComment<T extends HasJSDoc>(node: T): T {
Debug.assert(!node.jsDoc); // Should only be called once per node
const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), comment => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos));
const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), comment => shouldParseJSDoc(node, comment) && JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you consider having the scanner check for @link and @see in the code in scan() that already checks for JSDoc and sets the TokenFlags.PrecedingJSDocComment flag. This could either be a new flag, or you could simply say that in .ts files you only set the TokenFlags.PrecedingJSDocComment when there are @link and @see tags. Then withJSDoc would completely skip over this additional scanning which should save you even more time.

@sandersn

Copy link
Copy Markdown
MemberAuthor

Some quick replies:

  1. Jake Bailey (@jakebailey) None of the baselines change, and I thought they included jsdoc. I haven't looked at the code recently, but I definitely remember some processing of tags. On the other hand, I think there is fallback code that copies the comment span, so that's my guess
  2. if many scans of small slices takes 20% of parse time, I wonder how much time the main scan takes.
  3. I'll look at the other suggestions after I'm done with my current batch of 5.0 bugs.

@jakebailey

Copy link
Copy Markdown
Member

The baselines wouldn't include tsc, so the maximal thing we're able to test is to skip parse of non-see/link in tests. I think that's the worry, if we don't actually have any tests which verify this.

But that being said, it's just a comment, so I assume we don't actually reconstruct them at all, just copying them as is.

But I do think we need to find a way to pass this information down than to only set it for the tsc executable, and then include that in the compiler test harness as an "@" option.

@sandersn

Copy link
Copy Markdown
MemberAuthor

I ran tests with skipJSDoc forced true and all the failures were in fourslash excepta hilarious bug where @this isn't ignored in TS.

Since performance isn't (much of) a concern in tests I think it's worthwhile to default skipJSDoc=false in tests and only have a few tests where it's true.

@sandersn

Copy link
Copy Markdown
MemberAuthor

Next step on this PR is to implement Anders' idea to have the scanner mark link/see tags the first time it sees them.

@sandersn

Copy link
Copy Markdown
MemberAuthor

Superceded by #52921

@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants

@sandersn@typescript-bot@jakebailey@weswigham@ahejlsberg