News for hackers. Stuff that matters.
Re:The Windows Subsystem for Linux is now open source by pjc50 on Tuesday May 20, 2025 @04:31AM (#44039183)
The essential problem was that critical Windows APIs like CreateProcess and the NTFS file system were far too slow to be used in UNIX-like ways. If you tried to run git or build things in WSL1 - a key use case - it was way slower than doing so on native or VM Linux.
Re:The Windows Subsystem for Linux is now open source by whizzter on Tuesday May 20, 2025 @06:31AM (#44039929)
Performance was one problem, but imho the biggest was that MMAP semantics were inherited from the NT side and made a lot of applications crash (mmap's created could only be as large as the file's current size as in Windows, while Linux/BSD semantics allows for a mmap larger than the file that's usable without constant remapping as the file grows).

They didn't prioritize it until fixing at a late stage, barely before WSL 2 came out. Sometimes i do wonder if they made a premature decision to move to WSL2 since there was quite a lot of basic applications/runtimes that were crashing due to this fix lacking (Naturally a lot of other new Linux API's like io_uring probably would have made it an api chasing treadmill that they just wanted to circumvent).

Re:The Windows Subsystem for Linux is now open source by xeonmc on Tuesday May 20, 2025 @10:33AM (#44042102)
> (mmap's created could only be as large as the file's current size as in Windows, while Linux/BSD semantics allows for a mmap larger than the file that's usable without constant remapping as the file grows).

I thought you could do it using ntdll functions, no?

https://www.jeremyong.com/winapi/io/2024/11/03/windows-memor...

Re:The Windows Subsystem for Linux is now open source by whizzter on Tuesday May 20, 2025 @05:32PM (#44046124)
Good to know, still the obscureness of this function or semantics led WSL1 to be incompatible for a long time (Also skimming this article touches upon some 0-sized mappings being an issue?).

Regardless this led WSL1 to have fatal incompatibilities for a long time, iirc basic stuff like the rpm system or something similarly fundamental for some distros/languages relied on it. And once WSL2 existed people just seems to have gone over.

Re:The Windows Subsystem for Linux is now open source by camtarn on Tuesday May 20, 2025 @11:38AM (#44042824)
Hm. I used Git on WSL1 for many years, with medium sized repos hosted on a Windows drive, and it worked great. When I moved to WSL2 Git became a whole lot slower - it now takes about 5-8 secs to execute 'git status' where before it was instant.
Re:The Windows Subsystem for Linux is now open source by blackoil on Tuesday May 20, 2025 @01:24PM (#44043847)
Are your git repos in ntfs? WSL1 Linux drives are slow and in WSL2 Ntfs.
Re:The Windows Subsystem for Linux is now open source by camtarn on Wednesday May 21, 2025 @04:05AM (#44049312)
Yes, exactly, this is well known. So the parent post seems incorrect.
Re:The Windows Subsystem for Linux is now open source by dblohm7 on Tuesday May 20, 2025 @01:43PM (#44044021)
Win32 APIs like CreateProcess suck because they have to spend so much time setting up the stuff that allows Win32's application model to mimic that of 16-bit Windows, which was coopreratively multitasked. The NT kernel is much faster at creating processes when it doesn't need to worry about that stuff.

As for NTFS: it's not NTFS specifically, it's the way the I/O system is designed in the NT kernel. Imagine any call from outside that layer transitioning through a stack of filter drivers before actually reaching the implementation. Very powerful stuff, but also very bad for performance.

Re:The Windows Subsystem for Linux is now open source by wahern on Tuesday May 20, 2025 @04:04PM (#44045351)
> Imagine any call from outside that layer transitioning through a stack of filter drivers before actually reaching the implementation.

Linux BPF programmers say, "hold my beer, watch this!"

They can code 12 BPF filters for the price of 3 Windows filters.

Re:The Windows Subsystem for Linux is now open source by dmatech on Tuesday May 20, 2025 @07:35PM (#44046968)
Windows actually created a new process type for this: Pico processes[1]. This allows WSL1 to perform quite a bit better than Cygwin on something like Windows XP.

1. https://learn.microsoft.com/en-us/archive/blogs/wsl/pico-pro...