logoalt Hacker News

alberthtoday at 12:00 AM4 repliesview on HN

Would you mind elaborating (for those of us uninformed)


Replies

omcnoetoday at 12:57 AM

/mnt/c is a mounted C: drive in WSL2, that allows WSL2 guests to read/write files on the Windows host.

The mount is fine and speedy enough, but the underlying reads/writes turn into native NTFS reads/writes through Windows. NTFS file API is incredibly slow - high fixed overhead for initial file access.

So patterns like node_modules with many small individual files (or compiling code in general) are much much slower on Windows or WSL2 /mnt/c due to the fixed overhead adding up over a large number of files.

It's a ridiculous problem that has plagued Windows for years.

show 1 reply
weird-eye-issuetoday at 12:11 AM

One example is that if you have a node modules folder on Windows and you try to delete it from WSL it can take 10 plus minutes whereas if you deleted it directly in Windows it would have just taken a few seconds

Also if you try running Next js from files on Windows from WSL it takes minutes for each page to compile to the point that any local development is impossible so you would have to either run the Next JS server on Windows or move the files to WSL

yakztoday at 12:04 AM

It's difficult to overstate how horrible the performance is.

tonymettoday at 12:11 AM

WSL2 is a VM based on a Windows virtual disk file (VHD). inside that VHD IO is quite fast , a couple degrees worse than native. /mnt/c is how you access your windows files, but it's slow like NFS (socket based). anything needing high IOPS will be dog slow e.g. compiles, file scanning, etc.

the rule of thumb without the newest features is to copy work to/from /mnt/c into $HOME as needed.