Hacker News new | past | comments | ask | show | jobs | submit login

It shrinks the VHD automatically??

And yes the \\wsl$ is the 9P server I just tried to explain is incredibly slow compared to normal files on WSL1. I haven't tried WSL2 yet but I don't expect going through a VM would be faster.




I've never looked as to whether it shrinks it, but I assume not (that would be hard). OTOH, storage is cheap, so I've never really worried.

I never used WSL1 in anger, but accessing WSL2 over the \\wsl$ is not particularly slow. It's not as fast as native, but I don't notice it. I do almost all of my access of files on the Linux image via a terminal and VSCode-over-WSL-Remote, though.


Well "storage is cheap" for you but why assume my money and everyone else's is cheap? I'm low on space and I need to shell out hundreds of dollars to get a larger version of what I have just to use WSL2. Or I could just keep using WSL1 and save my money, especially in this economy. Why in the world would I get a new SSD just for WSL2?

This isn't about using it "in anger". I'm not pushing it to some kind of corner case, you just need to use it for real instead of trying hello-world examples. You notice this immediately as you're dealing with nontrivial folder contents. To give you an idea, this is the speed of raw grep from inside WSL1 Ubuntu:

  $ time sudo grep -ri asfadsfadf /etc
  real    0m0.075s
  user    0m0.016s
  sys     0m0.063s
This is the speed from \\wsl$ (MSYS2):

  real    0m9.227s
  user    0m0.078s
  sys     0m0.561s
And this is the speed on the raw files from Windows (MSYS2):

  real    0m0.092s
  user    0m0.000s
  sys     0m0.046s
\\wsl$ is literally some 60x-70x slower than direct access, and it's not because I'm "using it in anger". If you don't believe me, try it yourself with any program you prefer and see if you get similar speed before you tell me I'm wrong.

This is par for the course on \\wsl$. Explorer lags, too, if you try to browse a folder with a bunch of subfolders that actually have some contents. It's plain as daylight to me. Not noticing to me is like not noticing that your car suddenly goes 1mph instead of 65mph.


That has been my experience as well.

WSL2 is much much faster.


Do you specifically mean \\wsl$ is much faster on WSL2?


  time grep -ri asfadsfadfg /home/me/python-venvs
  0.79s user
  0.14s system
  99% cpu
  0.928 total

  wsl time grep -ri asfadsfadfg /home/me/python-venvs
  0.83s user
  0.10s system
  99% cpu
  0.932 total
EDIT: cleaned up and formatted the output for better visibility, reacting to your comment.

First command ran from a zsh Terminal session in WSL

Second one ran from a powershell session using the wsl "bridge" executable.


I can't make sense of your command lines (why are you passing grep to grep??), but you're comparing pure-Windows against pure-WSL? I was comparing the two of those against \\wsl$ which is the slow one...


Any interaction with the linux filesystem.

With WSL 1 installing an Ubuntu package or performing an upgrade was unbearably slow, with WSL 2 it feels normal.

\\wsl$ is also much faster, yes


Normal interactions from within WSL of course feel normal. It's just a VM with a fancy name after all. Which is removing pretty much all the overhead of the Windows I/O system, and which has hence been faster for ages. I'm surprised \\wsl$ would be faster though; that should have more overhead going through a VM, not less. If I ever try out WSL2 I'll have to give it a shot, but somehow my past experiences don't leave me optimistic...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: