Skip to content

Make useFsEvents as default strategy for the watching - #50366

Merged
sheetalkamat merged 10 commits into
mainfrom
defaultFsWatch
Sep 6, 2022
Merged

Make useFsEvents as default strategy for the watching#50366
sheetalkamat merged 10 commits into
mainfrom
defaultFsWatch

Conversation

@sheetalkamat

@sheetalkamatsheetalkamat commented Aug 18, 2022

Copy link
Copy Markdown
Member

Now that we have gotten better at handling inode movement etc and many people have tried using useFsEvents as default for watching files, make it default. This should give more agile callbacks compared to polling especially if it involves lots of files. It should also be better on CPU.

One catch on systems which have limits on fs watchers like linux, it would still fallback to polling but that was anyways done for the recursive directory watching so files is no different, but quantity varies so something to keep in mind.

This change also ensures that fsWatches are cached and reused with multiple callbacks instead of creating different fs watcher.

Most of the changes are refactoring on better baseline test infra update
10a7b4e actually has change to make fsEvents as default for file watching
61a99bf has change to cache the watches per name even when using fsEvents

@sheetalkamat

Copy link
Copy Markdown
MemberAuthor

@typescript-bot pack this

@typescript-bot

typescript-bot commented Aug 18, 2022

Copy link
Copy Markdown
Contributor

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

@typescript-bot

typescript-bot commented Aug 19, 2022

Copy link
Copy Markdown
Contributor

Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/132200/artifacts?artifactName=tgz&fileId=F58AE65CFEC67867EF3E5797F3FF232E3F3D49CBD5D1AA41AAD5889C4F365B5602&fileName=/typescript-4.9.0-insiders.20220819.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@4.9.0-pr-50366-2".;

@DanielRosenwasser

DanielRosenwasser commented Aug 22, 2022

Copy link
Copy Markdown
Member

I wonder if you can see a change in TSServer perf tests.

@typescript-bot perf test this

@typescript-bot

typescript-bot commented Aug 22, 2022

Copy link
Copy Markdown
Contributor

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

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

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

Here they are:

Compiler

Comparison Report - main..50366
Metricmain50366DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used361,825k (± 0.03%)361,797k (± 0.02%)-28k (- 0.01%)361,679k361,920k
Parse Time2.08s (± 0.56%)2.10s (± 0.54%)+0.02s (+ 0.82%)2.07s2.13s
Bind Time0.80s (± 1.23%)0.79s (± 0.94%)-0.01s (- 0.63%)0.78s0.81s
Check Time6.01s (± 0.62%)5.99s (± 0.63%)-0.01s (- 0.23%)5.88s6.05s
Emit Time5.98s (± 0.69%)5.97s (± 0.74%)-0.01s (- 0.20%)5.90s6.07s
Total Time14.87s (± 0.38%)14.86s (± 0.53%)-0.01s (- 0.09%)14.64s14.99s
Compiler-Unions - node (v10.16.3, x64)
Memory used205,917k (± 0.04%)205,913k (± 0.03%)-5k (- 0.00%)205,753k206,086k
Parse Time0.83s (± 0.93%)0.83s (± 1.02%)-0.00s (- 0.24%)0.81s0.84s
Bind Time0.47s (± 1.25%)0.48s (± 1.43%)+0.00s (+ 0.42%)0.46s0.49s
Check Time7.35s (± 0.47%)7.33s (± 0.63%)-0.02s (- 0.30%)7.21s7.41s
Emit Time2.46s (± 0.70%)2.44s (± 0.73%)-0.02s (- 0.85%)2.39s2.47s
Total Time11.12s (± 0.39%)11.07s (± 0.50%)-0.05s (- 0.42%)10.89s11.16s
Monaco - node (v10.16.3, x64)
Memory used344,259k (± 0.03%)344,261k (± 0.02%)+2k (+ 0.00%)344,090k344,386k
Parse Time1.61s (± 0.66%)1.60s (± 0.62%)-0.02s (- 0.99%)1.58s1.62s
Bind Time0.70s (± 0.63%)0.70s (± 0.68%)+0.00s (+ 0.14%)0.69s0.71s
Check Time6.00s (± 0.51%)5.97s (± 0.82%)-0.03s (- 0.53%)5.87s6.08s
Emit Time3.26s (± 0.89%)3.27s (± 1.10%)+0.01s (+ 0.31%)3.19s3.34s
Total Time11.57s (± 0.41%)11.53s (± 0.57%)-0.04s (- 0.35%)11.39s11.72s
TFS - node (v10.16.3, x64)
Memory used305,407k (± 0.02%)305,434k (± 0.02%)+27k (+ 0.01%)305,235k305,574k
Parse Time1.28s (± 0.53%)1.29s (± 0.47%)+0.00s (+ 0.08%)1.28s1.30s
Bind Time0.68s (± 0.74%)0.67s (± 0.66%)-0.00s (- 0.44%)0.66s0.68s
Check Time5.44s (± 0.38%)5.44s (± 0.45%)-0.00s (- 0.06%)5.39s5.49s
Emit Time3.42s (± 0.71%)3.44s (± 1.09%)+0.02s (+ 0.47%)3.36s3.52s
Total Time10.82s (± 0.37%)10.83s (± 0.27%)+0.01s (+ 0.09%)10.74s10.89s
material-ui - node (v10.16.3, x64)
Memory used473,088k (± 0.01%)473,136k (± 0.01%)+48k (+ 0.01%)473,052k473,246k
Parse Time1.83s (± 0.79%)1.83s (± 0.71%)-0.01s (- 0.33%)1.81s1.86s
Bind Time0.57s (± 1.85%)0.58s (± 1.71%)+0.01s (+ 1.39%)0.56s0.60s
Check Time14.61s (± 0.62%)14.60s (± 0.58%)-0.01s (- 0.05%)14.41s14.77s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time17.02s (± 0.57%)17.01s (± 0.52%)-0.01s (- 0.05%)16.81s17.19s
xstate - node (v10.16.3, x64)
Memory used583,209k (± 0.01%)586,471k (± 1.25%)+3,262k (+ 0.56%)582,971k616,138k
Parse Time2.61s (± 0.51%)2.59s (± 0.49%)-0.01s (- 0.58%)2.56s2.62s
Bind Time0.91s (± 1.16%)0.91s (± 0.64%)+0.00s (+ 0.00%)0.89s0.92s
Check Time1.58s (± 0.67%)1.56s (± 0.60%)-0.02s (- 1.08%)1.54s1.58s
Emit Time0.07s (± 3.14%)0.07s (± 3.14%)0.00s ( 0.00%)0.07s0.08s
Total Time5.16s (± 0.32%)5.13s (± 0.37%)-0.03s (- 0.64%)5.09s5.16s
Angular - node (v12.1.0, x64)
Memory used339,236k (± 0.07%)339,337k (± 0.02%)+100k (+ 0.03%)339,181k339,430k
Parse Time2.08s (± 0.62%)2.08s (± 0.45%)+0.00s (+ 0.00%)2.06s2.10s
Bind Time0.77s (± 1.06%)0.77s (± 1.20%)-0.00s (- 0.13%)0.76s0.80s
Check Time5.81s (± 0.51%)5.83s (± 0.65%)+0.02s (+ 0.33%)5.75s5.89s
Emit Time6.20s (± 0.68%)6.27s (± 0.98%)+0.07s (+ 1.06%)6.16s6.38s
Total Time14.86s (± 0.43%)14.95s (± 0.50%)+0.09s (+ 0.59%)14.78s15.10s
Compiler-Unions - node (v12.1.0, x64)
Memory used193,472k (± 0.09%)193,488k (± 0.11%)+16k (+ 0.01%)192,930k193,812k
Parse Time0.82s (± 0.79%)0.82s (± 1.00%)+0.00s (+ 0.24%)0.81s0.84s
Bind Time0.47s (± 0.94%)0.47s (± 1.26%)+0.00s (+ 0.64%)0.46s0.49s
Check Time6.88s (± 0.65%)6.85s (± 0.72%)-0.02s (- 0.31%)6.72s6.94s
Emit Time2.46s (± 1.39%)2.46s (± 0.91%)-0.01s (- 0.24%)2.42s2.50s
Total Time10.63s (± 0.53%)10.61s (± 0.69%)-0.02s (- 0.21%)10.42s10.72s
Monaco - node (v12.1.0, x64)
Memory used327,232k (± 0.02%)327,211k (± 0.02%)-21k (- 0.01%)327,046k327,423k
Parse Time1.58s (± 0.79%)1.58s (± 1.05%)0.00s ( 0.00%)1.55s1.62s
Bind Time0.70s (± 1.00%)0.70s (± 0.74%)-0.00s (- 0.29%)0.69s0.71s
Check Time5.85s (± 0.55%)5.81s (± 0.38%)-0.04s (- 0.72%)5.76s5.86s
Emit Time3.31s (± 0.87%)3.28s (± 0.93%)-0.03s (- 0.82%)3.20s3.35s
Total Time11.44s (± 0.56%)11.37s (± 0.44%)-0.07s (- 0.59%)11.26s11.46s
TFS - node (v12.1.0, x64)
Memory used290,024k (± 0.01%)290,043k (± 0.02%)+20k (+ 0.01%)289,885k290,157k
Parse Time1.30s (± 0.77%)1.30s (± 0.71%)-0.00s (- 0.15%)1.28s1.32s
Bind Time0.66s (± 1.59%)0.66s (± 1.05%)-0.01s (- 1.21%)0.64s0.67s
Check Time5.37s (± 0.55%)5.34s (± 0.56%)-0.03s (- 0.56%)5.26s5.40s
Emit Time3.50s (± 0.71%)3.46s (± 0.71%)-0.03s (- 0.92%)3.38s3.50s
Total Time10.83s (± 0.37%)10.76s (± 0.33%)-0.08s (- 0.70%)10.69s10.83s
material-ui - node (v12.1.0, x64)
Memory used451,978k (± 0.09%)452,080k (± 0.06%)+102k (+ 0.02%)451,015k452,333k
Parse Time1.81s (± 0.49%)1.81s (± 0.52%)-0.00s (- 0.06%)1.78s1.83s
Bind Time0.55s (± 0.67%)0.55s (± 0.94%)+0.00s (+ 0.92%)0.54s0.56s
Check Time13.18s (± 0.70%)13.14s (± 0.76%)-0.04s (- 0.31%)12.86s13.34s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.54s (± 0.61%)15.51s (± 0.67%)-0.04s (- 0.24%)15.20s15.70s
xstate - node (v12.1.0, x64)
Memory used548,375k (± 0.02%)548,359k (± 0.01%)-17k (- 0.00%)548,241k548,521k
Parse Time2.53s (± 0.71%)2.53s (± 0.58%)-0.00s (- 0.16%)2.49s2.55s
Bind Time0.89s (± 0.58%)0.89s (± 0.65%)-0.00s (- 0.45%)0.87s0.90s
Check Time1.51s (± 0.59%)1.52s (± 0.70%)+0.00s (+ 0.00%)1.49s1.54s
Emit Time0.07s (± 0.00%)0.07s (± 0.00%)0.00s ( 0.00%)0.07s0.07s
Total Time5.00s (± 0.40%)5.00s (± 0.39%)-0.00s (- 0.08%)4.95s5.03s
Angular - node (v14.15.1, x64)
Memory used337,306k (± 0.01%)337,290k (± 0.01%)-15k (- 0.00%)337,211k337,329k
Parse Time2.06s (± 1.60%)2.04s (± 0.33%)-0.02s (- 0.82%)2.03s2.06s
Bind Time0.80s (± 1.11%)0.79s (± 0.56%)-0.00s (- 0.63%)0.78s0.80s
Check Time5.82s (± 0.67%)5.81s (± 0.52%)-0.01s (- 0.22%)5.74s5.88s
Emit Time6.22s (± 0.98%)6.15s (± 0.91%)-0.07s (- 1.21%)6.04s6.28s
Total Time14.90s (± 0.76%)14.79s (± 0.57%)-0.11s (- 0.73%)14.61s14.95s
Compiler-Unions - node (v14.15.1, x64)
Memory used192,135k (± 0.02%)192,048k (± 0.12%)-87k (- 0.05%)191,090k192,232k
Parse Time0.85s (± 0.89%)0.85s (± 0.78%)-0.00s (- 0.12%)0.84s0.87s
Bind Time0.49s (± 0.61%)0.48s (± 1.02%)-0.00s (- 0.82%)0.48s0.50s
Check Time6.89s (± 0.55%)6.91s (± 0.67%)+0.01s (+ 0.20%)6.78s7.00s
Emit Time2.40s (± 0.62%)2.42s (± 0.75%)+0.02s (+ 0.96%)2.39s2.46s
Total Time10.63s (± 0.47%)10.66s (± 0.52%)+0.03s (+ 0.25%)10.52s10.77s
Monaco - node (v14.15.1, x64)
Memory used326,038k (± 0.01%)326,029k (± 0.01%)-9k (- 0.00%)325,981k326,089k
Parse Time1.57s (± 1.04%)1.57s (± 0.55%)-0.01s (- 0.38%)1.55s1.59s
Bind Time0.73s (± 0.65%)0.72s (± 0.62%)-0.01s (- 1.24%)0.71s0.73s
Check Time5.69s (± 0.41%)5.72s (± 0.63%)+0.03s (+ 0.49%)5.67s5.82s
Emit Time3.33s (± 0.88%)3.35s (± 0.66%)+0.01s (+ 0.36%)3.30s3.39s
Total Time11.33s (± 0.42%)11.35s (± 0.45%)+0.02s (+ 0.22%)11.25s11.47s
TFS - node (v14.15.1, x64)
Memory used289,108k (± 0.01%)289,109k (± 0.01%)+0k (+ 0.00%)289,078k289,165k
Parse Time1.32s (± 1.81%)1.32s (± 1.88%)+0.00s (+ 0.08%)1.28s1.38s
Bind Time0.72s (± 5.03%)0.73s (± 5.41%)+0.01s (+ 1.66%)0.67s0.80s
Check Time5.34s (± 0.52%)5.32s (± 0.45%)-0.02s (- 0.41%)5.26s5.36s
Emit Time3.54s (± 1.72%)3.52s (± 1.95%)-0.03s (- 0.79%)3.37s3.62s
Total Time10.93s (± 0.68%)10.90s (± 0.65%)-0.04s (- 0.32%)10.74s11.07s
material-ui - node (v14.15.1, x64)
Memory used450,475k (± 0.03%)450,547k (± 0.00%)+73k (+ 0.02%)450,477k450,583k
Parse Time1.86s (± 0.74%)1.86s (± 0.54%)-0.00s (- 0.00%)1.84s1.89s
Bind Time0.58s (± 0.77%)0.58s (± 0.96%)-0.00s (- 0.00%)0.57s0.59s
Check Time13.23s (± 0.97%)13.21s (± 0.61%)-0.02s (- 0.14%)13.01s13.41s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.67s (± 0.84%)15.66s (± 0.57%)-0.02s (- 0.11%)15.42s15.86s
xstate - node (v14.15.1, x64)
Memory used546,042k (± 0.00%)546,070k (± 0.01%)+29k (+ 0.01%)545,973k546,126k
Parse Time2.60s (± 0.67%)2.60s (± 0.38%)-0.00s (- 0.19%)2.57s2.62s
Bind Time0.98s (± 0.78%)0.98s (± 0.79%)+0.00s (+ 0.31%)0.97s1.00s
Check Time1.55s (± 0.56%)1.56s (± 0.53%)+0.01s (+ 0.45%)1.54s1.57s
Emit Time0.07s (± 3.14%)0.07s (± 0.00%)-0.00s (- 1.41%)0.07s0.07s
Total Time5.20s (± 0.41%)5.20s (± 0.26%)+0.00s (+ 0.08%)5.16s5.23s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v10.16.3, x64)
  • xstate - node (v12.1.0, x64)
  • xstate - node (v14.15.1, x64)
BenchmarkNameIterations
Current5036610
Baselinemain10

TSServer

Comparison Report - main..50366
Metricmain50366DeltaBestWorst
Compiler-UnionsTSServer - node (v10.16.3, x64)
Req 1 - updateOpen1,406ms (± 0.42%)1,401ms (± 0.43%)-5ms (- 0.38%)1,387ms1,412ms
Req 2 - geterr3,754ms (± 0.79%)3,743ms (± 0.33%)-11ms (- 0.30%)3,709ms3,765ms
Req 3 - references229ms (± 0.46%)229ms (± 0.52%)-0ms (- 0.13%)226ms231ms
Req 4 - navto174ms (± 0.90%)172ms (± 1.55%)-1ms (- 0.81%)168ms180ms
Req 5 - completionInfo count1,355 (± 0.00%)1,355 (± 0.00%)0 ( 0.00%)1,3551,355
Req 5 - completionInfo66ms (± 4.40%)63ms (± 4.19%)🟩-2ms (- 3.66%)59ms68ms
CompilerTSServer - node (v10.16.3, x64)
Req 1 - updateOpen1,511ms (± 0.38%)1,494ms (± 0.47%)-17ms (- 1.12%)1,479ms1,511ms
Req 2 - geterr2,232ms (± 0.59%)2,215ms (± 0.57%)-17ms (- 0.78%)2,187ms2,243ms
Req 3 - references240ms (± 0.76%)241ms (± 0.79%)+1ms (+ 0.21%)236ms245ms
Req 4 - navto186ms (± 0.69%)185ms (± 0.83%)-2ms (- 0.86%)181ms189ms
Req 5 - completionInfo count1,517 (± 0.00%)1,517 (± 0.00%)0 ( 0.00%)1,5171,517
Req 5 - completionInfo68ms (± 2.63%)68ms (± 1.89%)+0ms (+ 0.59%)64ms70ms
xstateTSServer - node (v10.16.3, x64)
Req 1 - updateOpen2,074ms (± 0.36%)2,082ms (± 0.50%)+8ms (+ 0.37%)2,056ms2,100ms
Req 2 - geterr780ms (± 0.37%)776ms (± 0.91%)-4ms (- 0.45%)766ms798ms
Req 3 - references101ms (± 1.29%)101ms (± 1.64%)+0ms (+ 0.20%)96ms104ms
Req 4 - navto233ms (± 0.91%)233ms (± 1.09%)-1ms (- 0.30%)228ms239ms
Req 5 - completionInfo count3,293 (± 0.00%)3,293 (± 0.00%)0 ( 0.00%)3,2933,293
Req 5 - completionInfo269ms (± 1.05%)271ms (± 1.44%)+2ms (+ 0.78%)266ms282ms
Compiler-UnionsTSServer - node (v12.1.0, x64)
Req 1 - updateOpen1,403ms (± 0.62%)1,405ms (± 0.83%)+2ms (+ 0.14%)1,385ms1,434ms
Req 2 - geterr3,498ms (± 0.54%)3,489ms (± 0.44%)-9ms (- 0.26%)3,459ms3,521ms
Req 3 - references219ms (± 0.57%)218ms (± 0.72%)-0ms (- 0.14%)215ms221ms
Req 4 - navto163ms (± 1.05%)161ms (± 1.40%)-2ms (- 1.05%)156ms167ms
Req 5 - completionInfo count1,355 (± 0.00%)1,355 (± 0.00%)0 ( 0.00%)1,3551,355
Req 5 - completionInfo58ms (± 5.22%)59ms (± 9.28%)+1ms (+ 1.89%)54ms81ms
CompilerTSServer - node (v12.1.0, x64)
Req 1 - updateOpen1,493ms (± 0.58%)1,496ms (± 0.41%)+3ms (+ 0.21%)1,483ms1,508ms
Req 2 - geterr2,162ms (± 0.54%)2,156ms (± 0.43%)-6ms (- 0.27%)2,140ms2,176ms
Req 3 - references232ms (± 0.58%)232ms (± 0.64%)-0ms (- 0.13%)228ms235ms
Req 4 - navto171ms (± 1.19%)170ms (± 0.76%)-2ms (- 0.88%)166ms173ms
Req 5 - completionInfo count1,517 (± 0.00%)1,517 (± 0.00%)0 ( 0.00%)1,5171,517
Req 5 - completionInfo63ms (± 2.93%)63ms (± 4.13%)-0ms (- 0.47%)57ms68ms
xstateTSServer - node (v12.1.0, x64)
Req 1 - updateOpen2,033ms (± 0.71%)2,031ms (± 0.41%)-2ms (- 0.07%)2,015ms2,050ms
Req 2 - geterr756ms (± 0.43%)752ms (± 0.42%)-4ms (- 0.52%)747ms758ms
Req 3 - references68ms (± 1.53%)67ms (± 0.97%)-1ms (- 1.47%)65ms68ms
Req 4 - navto226ms (± 0.59%)223ms (± 2.02%)-3ms (- 1.11%)210ms228ms
Req 5 - completionInfo count3,293 (± 0.00%)3,293 (± 0.00%)0 ( 0.00%)3,2933,293
Req 5 - completionInfo268ms (± 1.00%)268ms (± 0.86%)-0ms (- 0.07%)264ms275ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,443ms (± 0.63%)1,437ms (± 0.55%)-6ms (- 0.40%)1,425ms1,455ms
Req 2 - geterr3,638ms (± 0.57%)3,628ms (± 0.53%)-10ms (- 0.28%)3,595ms3,682ms
Req 3 - references229ms (± 0.50%)229ms (± 0.62%)-1ms (- 0.26%)226ms232ms
Req 4 - navto172ms (± 0.77%)171ms (± 0.71%)-1ms (- 0.64%)169ms175ms
Req 5 - completionInfo count1,355 (± 0.00%)1,355 (± 0.00%)0 ( 0.00%)1,3551,355
Req 5 - completionInfo60ms (± 4.62%)60ms (± 5.08%)+1ms (+ 1.17%)55ms67ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,529ms (± 0.87%)1,520ms (± 0.43%)-8ms (- 0.54%)1,504ms1,534ms
Req 2 - geterr2,294ms (± 0.45%)2,278ms (± 0.36%)-16ms (- 0.70%)2,254ms2,293ms
Req 3 - references243ms (± 0.54%)241ms (± 0.66%)-2ms (- 0.74%)239ms246ms
Req 4 - navto179ms (± 0.62%)178ms (± 0.41%)-1ms (- 0.67%)176ms179ms
Req 5 - completionInfo count1,517 (± 0.00%)1,517 (± 0.00%)0 ( 0.00%)1,5171,517
Req 5 - completionInfo53ms (± 1.10%)53ms (± 0.71%)-0ms (- 0.38%)52ms53ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,137ms (± 0.56%)2,128ms (± 0.41%)-9ms (- 0.43%)2,102ms2,143ms
Req 2 - geterr780ms (± 0.39%)777ms (± 0.38%)-3ms (- 0.44%)772ms786ms
Req 3 - references67ms (± 1.25%)66ms (± 1.99%)-0ms (- 0.45%)64ms70ms
Req 4 - navto229ms (± 0.78%)228ms (± 0.45%)-1ms (- 0.26%)226ms230ms
Req 5 - completionInfo count3,293 (± 0.00%)3,293 (± 0.00%)0 ( 0.00%)3,2933,293
Req 5 - completionInfo269ms (± 0.64%)269ms (± 0.73%)-0ms (- 0.04%)266ms274ms
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v10.16.3, x64)
  • Compiler-UnionsTSServer - node (v12.1.0, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v10.16.3, x64)
  • CompilerTSServer - node (v12.1.0, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v10.16.3, x64)
  • xstateTSServer - node (v12.1.0, x64)
  • xstateTSServer - node (v14.15.1, x64)
BenchmarkNameIterations
Current5036610
Baselinemain10

Developer Information:

Download Benchmark

@amcaseyamcasey left a comment

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 had trouble following some parts.

Comment threadsrc/compiler/sys.ts
Comment threadsrc/compiler/sys.ts
Comment threadsrc/compiler/sys.ts
Comment threadsrc/compiler/sys.ts Outdated
Comment threadsrc/compiler/sys.ts
Comment threadsrc/compiler/sys.ts
@sheetalkamat

Copy link
Copy Markdown
MemberAuthor

@amcasey any other feedback or is this good to go.. I would like to get this in sooner than later. Thanks

@sheetalkamat

Copy link
Copy Markdown
MemberAuthor

end up installing a lot of file-watchers and it would be good to improve the situation. Let me know if that's an accurate assessment.

Yes thats true.. also many users just increase limit of native file watchers instead of opting for fallback but then this was before things were not easily configurable.

Definitely can revisit this at later point.

@AaronFriel

Copy link
Copy Markdown

@sheetalkamat have to say I thought the blog post was interesting! I just did a deep dive on file-watching in Go for Pulumi and we ended up using a Rust binary to ship the feature.

Does this implementation of file-watchers use ignore files at all, to reduce the number of system calls needed to monitor a directory containing, e.g., node_modules?

@DanielRosenwasser

Copy link
Copy Markdown
Member

Love to find the community of people banging their heads against cross-platform file-watching!

During review of the blog post @sheetalkamat mentioned there's a few specific things in editor scenarios where we watch the node_modules directory instead of individual files within node_modules. But I might have misunderstood and she can fill in with more context.

@sheetalkamat

Copy link
Copy Markdown
MemberAuthor

As daniel mentioned, we watch node_modules instead of watching each file in editor scenarios. But apart from that when watching node_modules recursively, we have been ignoring files/directories starting with "." in node_modules. https://github.com/microsoft/TypeScript/blob/main/src/compiler/sys.ts#L487

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

6 participants

@sheetalkamat@typescript-bot@DanielRosenwasser@AaronFriel@amcasey@sandersn