If you've ever been curious about how Linux stacks up against Windows in terms of absolute raw
performance, then today is your lucky day. We're going to drag race Windows against Linux using a
including running both systems head to head on the bare metal. Then I'll test them each running with
WSL2 installed and compare native performance to the HyperV results and see how much, if any,
gets left on the table. We'll even throw the top of the line 20-core Mac Studio Ultra into
the mix to see how it compares to the Intel based systems. Then I'll present all kinds
of charts and graphs to show you the results. What's the fastest operating system? And is it
faster by 1%, or 5%, or 20%? I think quite a few people are going to be surprised with the results,
so let's get right down to business and start testing now so we can crown a winner today,
right here in Dave's Garage. [Intro]
Hey, I'm Dave, welcome to my shop! I'm Dave Plummer, a retired operating systems engineer
going back to the MS-DOS and Windows 95 days, and about a year ago I had what turned out to
be a fairly cool idea: I wrote a prime sieve in C++, Python, and C#, and then
tested how the relative performance compared between the languages. That was the start of the
desktop drag racing project and thanks to the hard work of folks such as Rutger and Tudor and all the
volunteers, the project has grown into a complete suite of performance metrics based on that prime
sieve in over 80 languages - from Ada to Zig and everything in between. I'll put a link to the
Primes project in the video description, as well as links to the most popular racing episodes.
Benchmarking two computers with just a prime sieve, though, is a very specific task.
It really comes down to how well written the compiler is as well as the libraries
that come with it. Some architectures also have an inherent advantage on a narrowly scoped problem:
for example, the Intel chips have instructions for manipulating bits right in place in memory,
whereas a RISC chip with a load-store architecture like the ARM CPU in my Mac Studio must load,
modify, and save the value back, which puts it at a slight speed disadvantage...
but just for that specific task. As a result, we'd like a more generalized
benchmark, and ideally, it should be a whole suite of tests. That suite should include a
wide range of workloads like compression, web processing, text rendering, physics,
image processing and so on. Such a wide array of tasks will yield a much more level playing field
than basing everything off a single problem. The benchmark suite that I ultimately settled on
is Geekbench 5, which is available for Windows, Mac, and Linux. For hardware I'm learning very
hard into the multicore space today - on the PC side we'll be running a Threadripper 3970X with
64 hyperthreaded cores, and for the Mac numbers, the top of the line 20 core Mac Studio Ultra.
That gives the PC a core count advantage, so I'll also run the benchmarks on the 5950X, which has
16 cores, just to see how they stack up. The first thing I'm going to do is to run
Geekbench on the bare metal of each system, seeing how they perform raw without any
virtualization or hypervisors to get in the way. Let's drop down to the desktop and get started!
You can download the free version of the benchmark software directly from Geekbench.com.
For the graphical desktops of Windows and the Mac, you simply need to browse to the
downloads page and pick the correct system. The download will start automatically and when it's
complete you simply run the installer. Then just start Geekbench5 like any other application.
If you're on a console such as a Linux server, things are a bit more complicated. I used the
text mode browser Lynx to download a copy just to prove it's possible to do in a browser without a
mouse and a GUI, but you should really just use the wget command to grab the file from the link
in the video description. wget
https://cdn.geekbench.com/Geekbench-5.4.5-Linux.tar.gz As you can see, the file has two extensions.
It a gzip-compressed tar archive, so the first thing we have to do is decompress it with gunzip.
Next, use tar with the xvf command to extract the contents of the tar arhive into a new folder.
When that is complete, drop into the new folder, called something like Geekbench-Linux
with a version number in the middle. In that folder you'll find an executable
program called geekbench5, and you run that to launch the benchmark session. From there,
the run is fully automated and it will run to completion on its own.
Our first runs will be Geekbench under Ubuntu on the 5950X. I'll then repeat the runs on the 3970X
to gather those numbers as well. First, I'll run it under WSL which enables me to use the screen
capture software. The screen recorder no doubt impacts performance a little bit,
but it was equally true for all contenders except the bare metal runs, where I did not screen record
the results to ensure I achieved the highest possible score. I recorded that with my phone,
and we'll do that next. For now, though, let's continue under WSL2. This machine has 16
hyperthreaded CPU cores for a total of 32 threads which are accompanied by 32 gigabytes of memory.
The first thing that Geekbench does is run each of its subtests in single core mode.
This is where only one CPU core is employed to do a single copy of a single task at a time,
as fast as possible. It measures the absolute max single core performance of your machine.
To gather this score, it runs an impressive list of benchmarks.
It starts with AES encryption, and then text compression, image compression, web navigation,
HTML5 rendering, SQL database processing, PDF rendering, plain text rendering, the C compiler,
camera processing and physics simulations. But wait, there's more, because it next does blurs,
face detection in images, horizon detection, image inpainting, HDR image processing, ray tracing,
structure from motion, speech recognition, and finally, some machine learning for good measure.
As you can see, then, it's a very thorough test, especially compared
to running a single problem like a prime sieve on the hardware to measure the perf.
As soon as it's done the single threaded tests, it repeats the entire set but this time on all
cores at once. If the single core results tell you how quickly the CPU could return the first
result of a set, the multicore score really tells you how much work the CPU could get
done in the allotted time. It's a little like horsepower vs torque. Horsepower sells
computers, but its torque that wins races. As soon as the multicore tests are complete,
geekbench does NOT give you results directly; instead, it uploads them to the geekbench
results database and you are given a URL with which you can view them in a browser.
If you have a Geekbench account you can also assign those results into your account for
safekeeping with the second URL. Either way, that's when and where
you get the results: on their webpage. To do the bare metal testing I opted to go with
Linux Server rather than a desktop distribution, figuring that's where I would get the lowest
overheard and highest results. And so, I installed it raw on both the 5950X and the 3970X.
On the 3970X it was installed on a dedicated Optane 905P and on the 5950X, it was installed
to a Samsun 980Pro. Both are very fast drives. One the install was complete I removed the boot
media and rebooted the system to bring up Linux for for the first time on the machine.
I had to swap which of the two Ethernet ports on the back of the machine was used,
as it blocked at network startup until I did so. A Linux install is fairly seamless these days,
but you can still run into issues that likely wouldn't confront Windows setup.
As soon as the machine came up, I supplied my new username and and password before running
'sudo apt update' and 'sudo apt upgrade' to bring the machine up to date. Next, I used wget
to retrieve the file, gunzip to decompress it, and tar to extract the contents to a new folder.
After I CD into that folder I can run the geekbench5 application directly.
Just like the WSL case, we let it run on its own and it walks through all of the test cases.
We can see the machine is properly identified as having 32 cores, 64 threads, and 126GB of memory.
I'm not sure where the other 2GB went, they must be reserved for Linux itself,
which is weird, because you'd figure that 640K should be enough for anybody.
Once it runs through both the single and multicore scenarios I use the lynx browser
to launch the URL, whereupon I can review the scores for each individual test if I
wish to. For now I'll just write down the overall singlecore and multicore results.
Next, we can do this under Windows, where the procedure is much the same. Under Windows we
are presented with a simple GUI that we can use to control and launch the benchmarks, and
just as we did with the console version we let it run to completion and then visit the URL that it
kicks out in order to get the full results. Next, I want to repeat the Linux tests from
within a Docker container. There's a GitHub project with a docker container already setup
and ready to run Geekbench, and I'll put a link to it in the video description for your convenience.
Assuming you have docker installed, you can launch the Geekbench suite easily with the
docker run command and the image name. Running the benchmark under Docker looks
pretty much identical to running it from the Linux command line, with the exception that
under Memory Information we can see that the docker container is only granted access to 32G
of memory while the machine itself has 128GB. After I completed this suite of tests on one
CPU I then ran the same suite on each of the others so that I had results for Ryzen 5950X,
the Threadripper 3970X, the Mac Mini, the MacBook Pro Max, and the Mac Studio Ultra.
And with that we can finally turn to some charts and graphs! Rather than hold out till the end,
I'll start with the big picture: Windows vs Linux on the bare metal.
This graph compares the performance of Windows and Linux when running on the
same hardware. Each was booted from its own dedicated hard drive, and there was
no virtualization or hypervisor involved. As you can see, Linux comes in at 1370 and
Windows is right with it at 1348, which is a little over 98% the performance of Linux.
I'm actually quite surprised that the result is that close when the software benchmark
is a complete as Geekbench seems to be. I honestly wasn't sure who was going to win,
but I was reasonably confident that the gap would be much wider than 1-2%. I think that
bodes well for us, though, indicating that both are approaching the performance limits of what
is possible. Whichever one you choose to run, it's making near optimal use of the hardware.
It's likely worth noting that while Linux eeked out a 2% win here, it was on a server edition
running a pure console with no desktop, no mouse pointer, and so on. Windows, on the other hand,
was logged into a user desktop session. That means Geekbench was running in a Window,
which was on a desktop, which was part of a windowstation, and so on. I don't think that
should have a 2% effect on the benchmark results, just noting it for completeness.
Next, let's take a look at the difference between running on the bare metal vs under the WSL2
Hypervisor, and then we'll compare both of those scenarios to running within a Docker container.
This graph illustrates the results: Linux Bare Metal at 1370, Windows at 1348, and WSL2 at 1311.
The fact that WSL2 turns in 96% of the performance of a bare metal Linux installation is a pretty
compelling reason to run it that way, I think. But if you're really in a scenario where 4%
makes all the difference, now you know! Docker, on the other hand, did impose a
significant hit of about 15% in my testing. The Processor Information displayed during the
Geekbench run showed that Docker was getting access to all of the cores, but only 32Gig
of memory, while the native numbers were run with 128Gig. As noted I tried specifying more, but the
Docker container seemed to max out at 32G. I doubt that Geekbench is so demanding of memory that it
accounts for much of the difference, however. If you know how I can grant more than 32G to a Docker
container, please let me know in the comments! With Docker, of course, the environment is fully
virtualized, so some overhead is to be expected. Running software as a container can be hugely
convenient, so even though 15% sounds like a lot, it might just be worth it in many cases.
When it came time for multithreaded testing, Linux again scores a win with Windows trailing
at 95% the speed. Linux running under WSL comes in right behind that at 92%.
One thing I don't know enough about is how the CPU is scheduled by the hypervisor.
Is the Linux WSL multithreaded case hobbled in some way by the Windows scheduler, or is it of
no consequence to the Linux side? And if it isn't, then what arbitration scheme is actually used to
allocate CPU time slices amongst the hypervisor clients? That's another one were if you know the
answer, please let me know in the comments, or join the Discord and let us all know!
With Linux in a Docker container, we see about the same performance impact in the multithreaded case
as we did in the single threaded container: it produces 86% of the performance of the
Linux bare metal case. That said, however, it's important to note that this was Docker
for Windows running an Ubuntu container which likely uses WSL and so that 86% should really
be viewed in light of the WSL numbers and not the raw hardware numbers. In other words,
it was running at about 92% of the performance of the environment in which it was operating.
Let's round out the picture now by including the Mac in the mix. Geekbench runs natively on the
ARM Macs so it's a perfect opportunity to compare Mac vs Windows vs Linux.
This first chart illustrates the single core results. It includes
three different Macs ranging from the entry level Mac Mini to the top-of-the-line
Mac Ultra Studio. As expected, the M1 performance for single core workloads is fairly consistent
across all of the chips., with a best of 1777. The next highest score was turned in on the
5950X by Linux under WSL at 1780 and Linux on the bare metal at 1781. Note how close
those numbers are. It means that Windows WSL was able to turn in 99.94% of the bare metal
performance. This wasn't the case on the ThreadRipper but it certainly seems like the
Ryzen 5950X is a wash whether it's under WSL or not. Another strong argument for WSL, I'd say.
This final chart is, I think, the most interesting and revealing of them all.
It focuses on the multicore results and the placement of the various Macs tells us a great
deal. The M1 MAX turns in a multithreaded benchmark as 12649 that is about 85% of the
overall score of the Ryzen 5950X. The 20 core Mac Ultra is a solid 50% faster than the Ryzen chip.
The 3970 Threadripper turns in a best of 29,034, which is 25% faster than the Mac Ultra.
We already covered all the relative scores of Linux and Windows in each of these cases,
and so with the Mac numbers in context, we can move on to declare a winner.
Like a real drag race, sometimes the results are determined by hundreds or thousandths of a second.
And so regardless of how close it is, I too have to pick a winner, and today's winner is: Linux!
In summary, on the 5950X, Linux bests Windows by about 3-5% in the single threaded and
multi-threaded workloads. On the the 3970X, that margin drops to 2% on single threaded workloads.
There certainly are environments and problems where 2% is a material
difference - but whether it's worth whatever tradeoffs you have to make to get that 2%
is another question, and one that only you can answer.
I'd love to hear your thoughts about these results - I'll be watching the comments for clever
insights, so don't leave me hanging! [Closing]
If along the way you found today's episode to be any combination of entertaining or informative,
I'd be honored if you'd consider leaving it a like and subscribing to my channel.
If you have any interest in matters related to Autism, Asperger's, or ASD,
please check out my book on Amazon, Secrets of the Autistic Millionaire. It's got nothing to
do with money and everything to do with living a successful life on the spectrum. It's everything
I know now that I wish I'd known back then. Remember I'm mostly in this for the subs and
likes, so please be sure to leave me one of each before you go today. In
the meantime, and in between time, I hope to see you next time, right here in Dave's Garage.