top of page
Search

Closing the Gap

  • Peter
  • Jun 8, 2024
  • 3 min read

Updated: Aug 12, 2024

In the last few weeks I have upgraded the linux PC's CPU and GPU to make a more substantial push towards at least matching the M2 Mac's performance on more benchmarks, and also to turn it into a more capable machine for everyday use.


The Upgrades

Because I wasn't ready to put substantial funds into a new motherboard or memory modules, I purchased with what appears to be the most cost-effective AM4-socket CPU for my two goals - the AMD Ryzen 7 5700X. According to cpubenchmark.net this CPU provides close to the maximum single-threaded processing throughput for any AM4 socket CPU while still having a full 8 cores (16 threads) to turn my PC into a powerful workstation.


For GPU I picked up an old NVidia GTX 970 on facebook marketplace. This is quite an old card, but still has plenty of shader units for accelerating my Alacritty terminals on my two 4K displays, and enough HDMI/DP outputs for me to eventually add two more 4K displays.


After struggling through my first foray at installing proprietary NVidia drivers on Ubuntu (Ubuntu doesn't install drivers automatically, and the first driver version I selected wouldn't boot) I now have a very fast Linux PC, and performing day-to-day work on it is pretty enjoyable despite some rough edges. I'm also enjoying the satisfaction of doing my work on a machine that I built myself with cheap 2nd-hand parts as a starting point, but which now feels very comparable to the Mac, and with only about $1000AUD spent so far.


New Benchmarks

Here are the benchmark results for the M2 Macbook Pro versus the PC runnings its new 5700X CPU. Also to provide some perspective I have included the results from the PC when it was running its 3200G CPU in stock mode, as well as the results when it was running with memory overclocked to 3466M/T.


ripgrep / git status


These disk-heavy benchmarks had already been favouring the PC, possibly due to faster SSD hardware or perhaps better software efficiency courtesy of Linux. The more powerful 5700X CPU further increases the PC's lead over the Mac but only by a small amount. Also much of these gains had already been achieved during my memory-overclocking experiments on the 3200G, which suggests that further small gains could be made here by overclocking the memory on the 5700X. (Update: memory overclocking experiments were performed on the 5700X.)


git log

The "git log" workload is a bit more CPU-intensive and now the PC is able to pull ahead of the Mac thanks to its massively increased processing power.


pytest (single tests / empty test)

The pytest benchmark results are probably mostly limited by single-threaded CPU performance, and the 5700X is able to complete the benchmarks 50% faster than the 3200G, although it still 20% slower than the M2 mac.


mypy

Mypy is also largely limited by single-threaded CPU performance, but I suspect memory speed and/or latency is also an important factor. The 5700X is a healthy 65% faster than the 3200G, but still a massive 51% slower than the M2 Mac.


Summary / Next Steps

With the new 5700X the PC is now faster than the Mac for half the benchmarks, although there is still a lot of ground to cover to win the last 3 benchmarks.


I suspect there is no CPU on the AM4 socket that can increase single-thread performance enough to win any more of the benchmarks. If I upgrade to an AM5 socket then I can probably get enough performance lift to win the pytest benchmarks, but the Mac is so far head on the mypy benchmark that it's unlikely that anything in the AMD 7000 series can catch it, since they are generally focused on multi-core performance.


The best hope of winning the last 3 benchmarks is to make a big switch over to an Intel 12900, 13700, or 13900 which have very good single-core performance and were all available for sale at the time I started the new job.


Upgrading the Motherboard/CPU to a new platform will also be an opportunity to make the jump to DDR5 memory, at which time I can buy some better-spec'd memory with much lower latency and starting pushing the PC to it's maximum potential.

 
 
 

Recent Posts

See All
Benchmark Calibration

I believe it is necessary to take a closer look at my benchmarking suite. Three things have led to this: Some previous experiments were...

 
 
 

Comments


Powered and secured by Wix

Subscribe for blog updates

Thanks for submitting!

bottom of page