top | item 34638889

(no title)

cercatrova | 3 years ago

WSL2 with code inside the Linux file system? Because if you're doing Linux work on the Windows file system, it will be bad. It is at native speeds inside the Linux file system though.

discuss

order

thesz|3 years ago

Yes, the file system appears to be Windows one.

I remember no questions being asked when I set up WSL2.

I really doubt that WSL2 will be at native speed with the Linux file system, because reads and writes still have to go through Windows kernel to be mapped into actual hardware reads/writes.

sz4kerto|3 years ago

> I really doubt that WSL2 will be at native speed with the Linux file system, because reads and writes still have to go through Windows kernel to be mapped into actual hardware reads/writes.

No, Linux is running alongside Windows, not under it. Windows itself is virtualized when WSL2 is turned on, and both Linux and Windows run under Hyper-V. It's quite fancy actually.

wongarsu|3 years ago

> I remember no questions being asked when I set up WSL2.

If the (WSL) path to your project is inside ~/ it's on the linux file system. If it's in /mnt/c/ it's in the Windows filesystem. In WSL1 those were about equally fast, both going throught the windows kernel. With WSL2, accessing /mnt/c/ from Linux has to go through Windows, and accessing \\wsl$ from Windows has to go through Linux, so where you put the files decides where they are fast.

pacoverdi|3 years ago

> I really doubt that WSL2 will be at native speed with the Linux file system

I had the same doubts, but when I finally took the time to install it, I found out that I was wrong. One Java program that I use, which is very heavy on the filesystem and slow like hell under Windows it a LOT faster under WSL2.

As Java profiler support is poor on Windows, I now use WSL2 to run async-profiler sessions and get results as accurate as on native Linux.

EDIT to add: you really have to run things fully in the WSL2 filesystem, be it for compiling or using a program. The performance is awful if you run WSL2 processes under the Windows filesystem.

cercatrova|3 years ago

You are incorrect in the last paragraph but that was already explained here. Try putting the files in the Linux file system and only using that.

Kipters|3 years ago

They will go through Hyper-V, not Windows