Microsoft is preparing to release the Windows May 2020 Update (20H1). This update will include several nice user interface improvements, but for developers and others in the know, what's more important is that the new version of Windows will introduce (Windows Subsystem for Linux). This is relevant information for those who wanted to switch to the Windows OS but couldn't make the decision.
Dave Rupert installed WSL 2 on his 13-inch Surface laptop, and the initial results
were pleasantly surprising:

The second version of WSL is 13 times faster than the first! It’s not every day that you get a 13-fold performance boost for free. I felt a shiver and shed a bitter male tear when I first saw these results. Why? Well, mostly I was mourning the lost time accumulated over 5 years of working with the first version of WSL.
And it's not just numbers. In WSL 2, installing npm, building, packaging, browsing files, hot module reloading, starting servers — almost everything I use daily as a web developer became significantly faster. It feels like sitting back at a Mac again (or maybe even better, as Apple has been radically throttling its processors in favor of increased battery life over the last few years).
What’s behind this speed?
How did they achieve a 13-fold performance increase? Earlier, when I considered transitioning to a Mac, I also threw out some ideas, purely on a speculative level. The issue was that disk writes and system calls in Linux were quite costly (in terms of time) due to the architecture of the first version of WSL. And now, guess what modern web development largely relies on? Yes. When you’re piecing together a bunch of dependencies and code snippets with each file save, you’re really performing a lot of disk writes and system calls for tens of thousands of files.
Once you learn about this from your bitter experience, it’s hard to forget. You gradually start to fall into despair when picturing how slowly and sadly everything works. And you realize that your world will never be the same, and the tool you once liked no longer seems useful and efficient.
Fortunately, the WSL team took a risk and completely rewrote the subsystem. In WSL 2, these issues have been resolved: developers integrated a native Linux virtual machine into Windows and assigned file operations to a VHD (Virtual Hardware Disk). The compromise is that during the first launch, you need to spend some time spinning up the virtual machine. This time is measured in milliseconds and, personally, I barely notice it. For example, I wait with pleasure, knowing what it’s all for.
Where will the files live now?
To fully benefit from WSL 2, you will want to move your project files from /mnt/c/Users/<имя пользователя>/ to the new home directory ~\/Linux on the new VHD. You can see the contents of this disk in the network by going to \\ wsl $ \ <distribution name> \ <username> \ home or by typing the command explorer.exe from your Bash shell.
This is a real Linux file system, and it acts and behaves just as you would expect. I created a folder ~\/projects, where all my project repositories reside, and then I open projects in Visual Studio Code using the command code.
What about VS Code?
Installing WSL- for remote development in VS Code (VS Code Remote - WSL) is the final step that ensures a comfortable developer experience. The extension allows VS Code to perform all its operations (git commands, console, installation of extensions, etc.) directly interacting with the Linux virtual machine. This makes the whole process very autonomous.
Initially, I was a bit frustrated by the need to install this extension because I had to reinstall what I had set up before. But now I appreciate it because there is a dedicated visualization layer that shows what environment I'm working in and where my files live. This has made the web development process on Windows more transparent and greatly simplified the user interface for version control in VS Code.
Tears of joy and hope for a bright future
I can't shake the feeling of joy thinking about the upcoming Windows May 2020 Update and the optimized Linux subsystem that just flies on my powerful gaming PC. There may still be some issues I am unaware of, but after I have concluded that the WSL team has resolved most issues.
Moreover, it's worth remembering that it's great too! It's as if they heard my complaints about the lack of tabs, JSON Settings, and the need to 'feel cool' on Windows. It still sounds strange, but Windows Terminal is probably the best terminal for Windows.
Having worked on Windows for 5 years, I've experienced a lot: the inability to install Rails, struggles with artificial shells like Cygwin. I was in the front row at that very Build 2016 conference when Microsoft announced the first version of WSL. That gave me hope that web development on Windows would finally reach a new level. Without a doubt, WSL 2 is the biggest improvement I've seen since then, and it seems we are on the brink of a new era.
Advertising
If you need Windows servers, then you definitely — automatic installation of Windows Server 2012, 2016, or 2019 on plans with 2 GB RAM or more, the license is already included in the price. Starting at 21 rubles per day! And we also have perpetual servers 😉
Source: habr.com
