3 ms·
Note that this content is one year old. At that point, WSL was not a virtual machine, it was Linux syscall emulation in the NT kernel.
by Kwpolska 7y ago
Note that this content is one year old. At that point, WSL was not a virtual machine, it was Linux syscall emulation in the NT kernel.
- kgwxd 7y agoDoes that mean it's faster or slower now?
- swiley 7y agoI would be shocked if it were faster.
- plexicle 7y agoIt is MUCH faster.
- kgwxd 7y agoI was specifically curious about input latency. Is that what you're saying is much faster, or just WSL in general?
- tuwtuwtuwtuw 7y agoIt's faster now.
- ohthehugemanate 7y agoDepends on the operation in question. Direct syscalls should be faster, but there are some big differences between the NT and Linux kernels. You end up getting all the poor performance areas of BOTH. That, and HyperV has an extremely fast lightweight VM mode for particular hardware. For example, running containers on HyperV actually runs them with VM level isolation, a la Kata containers... and at competitive speeds. An example of the worst of both worlds result is the filesystem. In the NT kernel, every filesystem call goes through a series of Filters: any program can provide filters for given file types. Filters can do anything, from antivirus programs scanning the file on access, to Notepad adding itself to the Context Menu as an "open with Notepad" item. This makes filesystem access - even metadata checks - very time expensive on Windows. On Linux, we keep file metadata in memory, which is memory expensive, but it makes certain filesystem operations very fast. The result of mapping one onto the other is a combined filesystem operation which is memory expensive AND slow. So for example, on WSL 1 (mapped syscalls), using a git repo of any size is impossibly slow... on the order of 10 seconds to get a git status for a work project. But on WSL2, the same syscalls live entirely inside the VM and are almost native fast.
- bpfrh 7y agoWSL2 is generaly faster: https://news.ycombinator.com/item?id=19868282 https://news.ycombinator.com/item?id=19868282
- anonymfus 7y agoProbably both on different tasks
- nickjj 7y agoIn terms of key press latency it makes no difference. Both the old and new MS terminal have about the same input latency. The problem is, the MS terminal doesn't work well with tmux which is a 100% deal breaker. WSL2's I/O is better but that's out of scope for this discussion and also a pretty sketchy thing to run as of today since it requires opting into the insider's release of Windows which has very questionable telemetry requirements.