WSL vs WSL2 Performance in Windows 10 May 2020 Update

After a long time considering Linux a cancer and its worst enemy, recently Microsoft has taken a special fondness for this operating system. There are things that a few years ago we would never have imagined, for example, that Microsoft was going to start developing open source software, that parts of Windows code were going to be released or that Linux was going to be able to be installed on top of the operating system. And this is how WSL came about .

Windows Subsystem for Linux , WSL, or Windows subsystem for Linux, is one of the tools that are part of the operating system, introduced several versions ago. WSL allows us to install a virtual Linux on top of our Windows 10, thanks to Hyper-V, so that we can have access to the Linux terminal and any program for it. A feature intended for developers and system administrators but liked even by less expert users.

WSL vs WSL2 Performance in Windows 10 May 2020 Update

With the release of Windows 10 May 2020 Update , Microsoft has released a new version of this subsystem, WSL2. This new version has arrived to solve the problems, or rather, the shortcomings, of the first version. Among its innovations, it stands out a much more modular design and great performance improvements. In addition, Microsoft has announced that in the future it will be possible to update the Kernel from Windows Update and even run Linux programs with a graphical interface from WSL2.

Despite all these improvements, WSL remains, broadly speaking, a virtualized Linux. So do we know what difference in performance there is between Linux on WSL, WSL2 or natively installed on a hard drive?

WSL2 is very close to native Ubuntu performance

The Phoronix portal has tested the performance of the old version of WSL, the new WSL2 and an Ubuntu natively installed on a PC in order to check how well the virtualization system of Windows 10 works.

For this, this portal has used its own benchmark suite, Phoronix Test Suite , with which it has tested the 3 systems with dozens of tests, all of them under the same conditions and circumstances. In this way, it has been possible to verify the good work that Microsoft is doing with its subsystem, although it is still somewhat far from native performance.

Most of the tests demonstrate a considerable evolution of WSL2 performance compared to WSL1, although there is still a difference between this subsystem and the native performance of Ubuntu. However, when analyzing the performance in terms of CPU use we can see that WSL2 is very close to Ubuntu, and even in some tests it exceeds performance.

WSL vs WSL2 vs Ubuntu en v2004 - 1

However, when working with APIs or compiling source code you can see that there is still a big gap between WSL and Linux.

WSL vs WSL2 vs Ubuntu en v2004 - 2

You can also see some tasks in which WSL1 far exceeds the performance of WSL2, although the truth is that they are very specific cases that, little by little, will be debugged. In general terms, you can see how WSL2 has significantly improved performance compared to WSL1, although it still has enough room for improvement to get to offer the same performance as a natively installed Ubuntu on Windows.

WSL vs WSL2 vs Ubuntu en v2004 - 3

Ubuntu wins, although for very little

Ubuntu finished first, that is, it achieved the best results, in 61% of the tests. WSL1 has been in a better position in 22% of them and, finally, WSL2 has only been in first place in 17% of them.

However, in the following graph we can see the average of all the marks obtained. And it is here where we can clearly see the evolution between WSL and WSL2 and how close the subsystem is to achieving the same performance as a Linux installed natively on the PC.

WSL vs WSL2 vs Ubuntu en v2004 - Total

Microsoft is still working to improve the performance of WSL2, and with the first build of Windows 10 21H1 support has been added to be able to use the GPU from this Windows subsystem for Linux . We will have to keep a close eye on how the subsystem continues to improve and if it really achieves, in the near future, equal or exceed a native installed Ubuntu.