Can someone explain the parse time difference between Windows shell and WSL2 under the same system below when running the same command under the same project?
As you can see there are also some differences in Files, Lines etc. Is there any way to speed up the WSL2 parse time?
tsc -project ./tsconfig.json --diagnostics
Windows 10 shell (tsc version 3.1.2)
Files: 139
Lines: 35528
Nodes: 150245
Identifiers: 49306
Symbols: 38212
Types: 2460
I/O read: 0.05s
I/O write: 0.01s
Parse time: 0.74s
Bind time: 0.13s
Check time: 0.48s
Emit time: 0.13s
Total time: 1.48s
WSL2 Ubuntu 18 LTS under the same system (tsc version 4.1.4)
Files: 175
Lines: 39622
Nodes: 161997
Identifiers: 56416
Symbols: 40823
Types: 2795
Instantiations: 12267
Memory used: 76663K
I/O read: 1.13s
I/O write: 0.16s
Parse time: 14.45s
Bind time: 0.36s
Check time: 0.39s
Emit time: 0.32s
Total time: 15.52s
This is very likely due to the very poor file performance in WSL2 for windows drives (everything under /mnt
). See the bug report for WSL2 here: https://github.com/microsoft/WSL/issues/4197
There could be some workarounds, the major one to me would be using WSL1 if you need to build from Linux on your machine.