# Compilation performance (gcc) of 8700k vs 9700k



## DavidZemon (Mar 30, 2019)

I'm having a lot of trouble finding compilation performance comparisons of the new 8c/8t vs old 6c/12t chip. I currently have a 6700k at home on a crappy motherboard (won't even run the RAM at it's xmp profile) and my new work desktop (an 8700k) compiles our firmware in 6.5 minutes compared to the 11 minutes in my home machine. Needless to say, I'm going into the office a lot more than I used to because of how much faster the PC is!

Our build is NOT making the best use of parallel jobs - there's a lot time spent linking large objects or running inefficient bash scripts. For this reason (and some heavy blue bias) I don't think ryzen would be a good choice; I need the single-core performance as well.

So this is what brings me to the 8700k v. 9700k. Has anyone actually run some gcc tests - such as compiling the Linux kernel - on these CPUs? I found a BIG chart of Linux kernel compile times, but it is notably lacking any 9th gen chips.

Also - I have Corsair lpx 3000 RAM and 970 Evo SSD, so I'm covered there. Just need new CPU/motherboard/cooler.

I do occasional gaming via steam's (AMAZING) new Linux support... But I don't expect either of these CPUs to make a difference when I'm running 1060 6GB GPU.


----------



## _UV_ (Mar 30, 2019)

https://www.phoronix.com/


----------



## DavidZemon (Mar 30, 2019)

Couldn't find anything while using Google to search that site, but the results did include this at least: https://www.anandtech.com/show/13400/intel-9th-gen-core-i9-9900k-i7-9700k-i5-9600k-review/7

That shows a measurable but small difference between the two when compiling chromium from Windows.

Would love to see more comparisons (Linux / gcc much appreciated, if possible) if anyone can find them.


----------



## DavidZemon (Apr 3, 2019)

Found this a while ago but want to post it here for saving. It is missing 9th generation numbers at the time of this post

https://openbenchmarking.org/showdown/pts/build-linux-kernel


----------



## xorbe (Apr 3, 2019)

HT adds about 25% on compile performance, so 6/12 is like 7.5/7.5, so then the 8/8 might squeak ahead a bit, but it's going to be not worth the effort of changing from 6/12 to 8/8, unless you have exactly 8T workloads.  If it's a new Linux system, I'd probably get the 8/8 myself.  Get the 6/12 if you run a lot of light threads perhaps.


----------



## Toothless (Apr 3, 2019)

If you need single thread and thread count, might be worth investing in a 9900k. It'll pay itself off with gas money saved.


----------



## DavidZemon (Apr 3, 2019)

Toothless said:


> If you need single thread and thread count, might be worth investing in a 9900k. It'll pay itself off with gas money saved.



Ha! I like your thought process  but not a chance. I could use it, for sure. It wouldn't go to waste. But I'm just too cheap for that.

I priced out the 9700k with motherboard and cooler and am suffering a bit of sticker shock. It's going to run me about $600. I'm hoping I can get about half that for my current combo... But that's still a lot of money. That has me considering ryzen a lot more seriously than I expected to be. I can pick up a working combo of 2700x + mobo for just $350 - meaning I'm out only $50. Starting to be a no brainier now! But that single core performance worries me...

So then I started thinking... What about a 9600k? That'll put me out around $140 instead of $300. I wonder how it will perform against the ryzen in kernel compile times...

Rough math... If the 9700k is slightly faster than 8700k and 8700k compiles in ~72s (source from link above), then let's just round and say the 9th gen does it in 70s. If we take two cores out we should see compile time jump up by a factor of 1.33, to 87.5. That's still MUCH better than the 118 measured by the same test on my CPU, but a fair ways off the 75 of the 2700x. But... The kernel is fairly well parallelized - better than much of the rest of our firmware. The increased single thread performance will be nice to have.

Or I try to hold my horses another six months and see what comes of 10th gen...


----------



## Toothless (Apr 3, 2019)

So first gen Ryzen had the single thread of Haswell. Second gen Ryzen has a bit of a boost over the first and honestly a 2700x would be better for your use. I'm personally waiting on third gen that should be coming out soon ish.


----------



## FordGT90Concept (Apr 3, 2019)

6,7,8,9 generation Intel processors...there's not much performance difference other than core count and clockspeed.

https://ark.intel.com/content/www/us/en/ark/compare.html?productIds=88195,186604,126684
https://www.amd.com/en/products/cpu/amd-ryzen-5-2600x
https://www.amd.com/en/products/cpu/amd-ryzen-7-2700x
https://hothardware.com/news/amd-allegedly-confirms-ryzen-7-3700x-ryzen-5-3600x-zen-2

Assuming SMT is giving a 20% uplift...


Model|Layout|GHz|IPS|Time|GI|Time|GI
2600X|6c/12t|3.6|25.92|
_579_
|
_15,000_
|94.2|2442
2700X|8c/16t|3.7|34.56|
_434_
|
_15,000_
|74.78|2584
3700X
|
12c/24t
|
4.2
|
60.48
|
_248_
|
_15,000_
|
_41.34_
|
_2500_

6700K|4c/8t|4.0|19.2|660|12,672|118.81|2281
8700K|6c/12t|3.7|26.64|390|10,390|71.56|2061
9700K|8c/8t|3.6|28.8|
_382_
|
_11,000_
|
_69.44_
|
_2000_So...let's figure about 12 tera-instructions to compile so we can roughly extrapolate for the unknowns (italicized in table)…

Now I'm going to add a theoretical for 3700X (underlined in table) which is coming in a few months for roughly $329...

Has anyone timed compiling that code on a Ryzen?  If my numbers are right, Ryzen 3700X could do it in just over 3 minutes.  Ryzen 2700X should theoretically be roughly equal to or a smidge faster than 8700K.

To answer your question bluntly, 8700K should be slightly faster than 9700K assuming the code is well multithreaded.


Edit: Didn't notice that link until now...going to run some more numbers and update the table...

AMD is approximately 2500 GI where Intel is ~2100 GI.  Because 6700K and 9700K is a pretty big gap in terms of time, I'm going to go with 2000 instead of 2100 due to optimizations and the like through the generations.  The difference between AMD and Intel here is because of cache misses and the like.  2500 vs 2000 basically represents the efficiency gap between the two architectures at compiling...

Looking at the table now...and using that benchmark as a baseline...
3700X > 9700K > 8700K > 2700X > 2600X > 6700K

This is giving the 9700K the benefit of the doubt  (scoring better per theoretically instruction than 8700K) and disadvantaging the 3700X (giving it a worse baseline than Zen+ gets).


Edit: Now I'm going to back and adjust your estimate compile time using the 2500/2000 baseline established by the benchmark...

Intel is roughly 25% faster than AMD so 12,000 gigainstructions for Intel turns into 15,000 for AMD...

More threads appears to suffer when compiling your code which should theoretically give the 9700K an advantage since it has no Hyperthreading...
3700X > 9700K > 8700K > 2700X > 2600X > 6700K


----------



## Vayra86 (Apr 3, 2019)

Get a new Ryzen honestly. Intel 9th gen high end is far too expensive for what if offers in performance advantage here.

ST is not your bottleneck, thread count is. All your options mainly improve on nT workloads to get those massive time wins.


----------



## R0H1T (Apr 3, 2019)

8700k is 6c/12t


----------



## FordGT90Concept (Apr 3, 2019)

OMG I flipped 8700K and 9700K around.  Fixing...

The throughput fell a lot for 8700K relative to 6700K which gives me the impression that a significant amount of work gets blocked by busy threads.  If all else is equal, higher clockspeed on fewer cores is probably going to come out ahead of lower clockspeed on more cores.  3700X wins both of those arguments if the rumors are to be believed.  Between 9700K and 8700K, I would go 9700K because I think 8 physical cores > 6c/12t as far as compiling is concerned.

Since the spread is so large between 8700K and 6700K to the detriment of 8700K, I stuck 9700K in between them.    I suspect it is closer to the 8700K than the 6700K though so the numbers are skewed in 9700Ks favor.

8700K and 9700K are likely to be very similar performing when taking into consideration the 6c/12t versus 8c/8t layout and 100 MHz difference in clockspeed.


----------



## DavidZemon (Apr 3, 2019)

All this activity, and numbers to back it up! Thank you!

First, someone up there ^^^ mentioned that I shouldn't worry about single-core performance since I'm talking about compiling Linux as a benchmark. Let me share with you a CPU usage graph of our firmware build during the last 150 seconds (out of ~690 seconds)




The blue on the left is CPU. As mentioned in my first post, there are parts of our build which make CRAP use of parallelism. There are other parts - like actually compiling the kernel and some of our newer apps - which make much better use of it. As an example of the bad: we have to compile the entire OpenSSL package without parallel jobs because we run into intermittent errors otherwise (maybe that's fixed in newer versions, but that's an ENTIRELY different discussion so let's please not turn this thread into "how can we improve David's build system").
Also, this is my personal machine at home. I do use it for more than compiling firmware for my job. Nearly everything else I do with it does not need the 8c/16t parallelism of a Ryzen 7 and will suffer from lower single-core performance (though perhaps a negligible amount, depending on the simplicity of the task). There are also many times when I hit compile errors which are thoroughly hidden in the mess of parallel jobs and the easiest way to find them is re-compile without parallelism. Long story short, the low clock frequency of 2nd gen Ryzen scares the crap out of me. I really wish I could just try out a Ryzen 2700x for a week and see how it goes (I suppose I'm far from the first person to say that on these forums... sorry).

Now, all this activity sparked an idea in my head: we don't have to be guessing about the effectiveness of HT. I can just build the firmware twice, once with and once without hyperthreading enabled on my 6700k. Of course the raw numbers are useless compared to the kernel-compile times above, but the ratio should be very helpful. So, without further ado: 


```
With Hyper-Threading
====================

real    11m28.925s
user    0m1.907s
sys    0m2.297s


Without Hyper-Threading
=======================

real    14m14.494s
user    0m1.562s
sys    0m2.128s
```

That comes out to 689 seconds with HT, and 854 seconds without. That's a 24% slow-down. @xorbe, you win the grand prize for guessing closest to the mark 

I'm going into the office today and will check if the Dell XPS 8930 bios has the option to turn off HT... but I'm not hopeful. If it does, I'll run the test again from there though.

@FordGT90Concept, would you mind uploading the original spreadsheet? That's a great resource and I'd love to dig into those numbers some.

And thank you for bringing up 3rd-gen Ryzen - I had no idea the clockspeed was supposed to jump that much! If they can truly hold to that rumor, especially with TDP staying at 105W, that will be a no-brainer!


----------



## FordGT90Concept (Apr 3, 2019)

So we know...
-8700K has a huge slump in performance compared to 6700K relative to maximum theoretical throughput (lack of parallelism throughout the whole process).
-SMT gives 124% performance instead of my 120% guesstimate when it is working on the parallel parts.
-AMD Zen+ has approximately 25% disadvantage (high estimate) compared to Intel Skylake and sons.

I didn't make a spreadsheet.  I just created the table and used a calculator to get the numbers.  I'm downloading LibreOffice now to create a spreadsheet.  Should be able to get some definitive answers with it and the information above...

Single and Multi are rough guestimates of where they are parallel and not:



I italicized fields that are guesses.

8700K and 9700K are very well matched.  8700K will do slightly better in single-threaded and 9700K will do slightly better in multithreaded.

Bare in mind that 3700X is expected to have at least 10% better single-threaded performance than 2700X but it is unlikely to catch the 8700K.  3700X can be expected to blow them all away in multithreaded because it has 4-8 more cores.


----------



## xorbe (Apr 3, 2019)

DavidZemon said:


> @xorbe, you win the grand prize for guessing closest to the mark



Well, a few months ago I benchmarked my delidded 8086K@5GHz with HT on and off in Linux while compiling things ...


----------



## DavidZemon (Apr 3, 2019)

Tom's Hardware has tamed my expectations of 3rd-gen Ryzen _significantly_. https://www.tomshardware.com/news/amd-ryzen-3000-everything-we-know,38233.html
Near the very bottom of the article is "The AdoredTV Leak" and anyone waiting for Ryzen 3 should absolutely read this section.

Given that, I'm going to assume that Zen 2 will come out this Spring/Summer and 10th gen core will come out this Fall, both with smaller processes and therefore significant performance and power improvements, but nothing unheard of relative to other die shrink enhancements from the past.


----------



## FordGT90Concept (Apr 3, 2019)

All will be revealed during Computex (May 27 keynote):
https://www.computextaipei.com.tw/en_US/news/info.html?id=6994382A4DFCD609


----------



## DavidZemon (Apr 3, 2019)

FordGT90Concept said:


> All will be revealed during Computex (May 27 keynote):
> https://www.computextaipei.com.tw/en_US/news/info.html?id=6994382A4DFCD609


Yep, that's what makes me think Spring/Summer release for Zen 2.

I really wanted to know what kind of performance enhancements 8th gen provides over 6th for compiling... WOW. Not much... Here's a test of one of our smaller apps. I ran "make clean && time make" on both my home machine and work machine:

22.646s vs 21.102s

7% slow down on the older machine. Not much for being two years older. So clearly the benefits I'm going to get by moving from Intel -> Intel are purely from the core/thread count, with little coming from architecture improvements.

Yikes.... my Dell XPS at work must be really held back by something (I suppose RAM and SSD are the only two things it could be, right?). I just ran a full build with a single job overnight on both machines and got 48m6.202s (home) vs 55m1.005s (work). Both have NVMe SSDs but my home machine has a 2 TB 970 EVO and the work machine has a slower 512 GB Toshiba KXG50ZNV512G. However, the RAM in my local machine is only running at 2133 and the Dell is running at 2666.


----------



## DavidZemon (Jul 22, 2019)

Well I finally did it. I bought a 3700x today. Microcenter has it for just _$330_ AND $50 off a matching motherboard. I have a mATX case, so my choices were limited... but that means I left the store having paid _$385 including tax_. HOLY COW. And I'm selling my 6700k + motherboard for $200.
This is one happy programmer over here


----------



## eidairaman1 (Jul 22, 2019)

Platform upgrades in cpu dept are bios update and cpu swap, easier than pulling a board out constantly...


----------



## DavidZemon (Jul 22, 2019)

eidairaman1 said:


> Platform upgrades in cpu dept are bios update and cpu swap, easier than pulling a board out constantly...



I'm afraid that I can not, for the life of me, figure out what you're trying to say.


----------



## eidairaman1 (Jul 22, 2019)

DavidZemon said:


> I'm afraid that I can not, for the life of me, figure out what you're trying to say.



Ok your platform which is Ryzen can be upgraded with just a bios update to the motherboard and a cpu swap, by far easier than having to change motherboards every other year...


----------



## DavidZemon (Jul 22, 2019)

Ah, yes. That is sort of true. Except, by the time i'm ready to upgrade this CPU, I'll likely be ready for a faster SSD and therefore PCIe 4 as well (to be clear - I went with a B450 due to mATX and Microcenter not having any better mATX options).


----------



## EvergreenSW (Aug 22, 2019)

DavidZemon said:


> Well I finally did it. I bought a 3700x today. Microcenter has it for just _$330_ AND $50 off a matching motherboard. I have a mATX case, so my choices were limited... but that means I left the store having paid _$385 including tax_. HOLY COW. And I'm selling my 6700k + motherboard for $200.
> This is one happy programmer over here



Any feedback on how the 3700X is working out for you? I'm in a very similar situation in terms of planning a new PC build for work. Most of my workload involves compiling the Linux kernel and doing builds through Yocto, at the moment all in a VM through VirtualBox.


----------



## DavidZemon (Aug 22, 2019)

EvergreenSW said:


> Any feedback on how the 3700X is working out for you? I'm in a very similar situation in terms of planning a new PC build for work. Most of my workload involves compiling the Linux kernel and doing builds through Yocto, at the moment all in a VM through VirtualBox.



You.
Will.
LOVE IT!

As I mentioned in an earlier post, my work PC does have a slower SSD (some cheap Toshiba NVMe I think it was, instead of the Samsung 970 EVO 2 TB at my house), but the RAM is now a closer match with my new motherboard capable of running the XMP profile for my DDR4 3000 at home. I bring this up so you understand that, for the most part, the following numbers are dependent only on the CPU, with the other hardware being "close enough" to have a negligible impact.

What takes 5m30s on my Ryzen 3700x takes about 8m30s on my work PC, which is the 8700k. And it's almost exactly twice as fast as my old 6700k, even though the 6700k was higher frequency.

That being said, I would recommend an aftermarket cooler, if you care about noise. The one that comes with was handling temps fine (not great, but it wasn't throttling), but it was constantly spinning up and making audible noise. I'll avoid making any specific cooler recommendations (quite off topic for this thread), but it was worth it for me.

Depending on just _how often_ you're running builds, and parallelized your builds really are, you may find it worth jumping to the 3900x even.

Clock rates are not great (4.25 single core, 3.95 all core) but I haven't noticed any change in day-to-day use (web browsing, boot time, developing with Java-based IDEs, etc). I haven't looked very hard at overclocking to reach a higher all-core clock... from what I've read, max you'll get is around 4.2-4.3, which would only be an 8% improvement _tops_ and that's just not enough to warrant the extra heat, the work involved in finding the right settings, and the potential instability.

Random side note: I wrote a short little script to show me the real-time CPU frequency on all cores since I was having trouble finding any good Gnome extensions to do so:


```
#!/bin/bash
watch -n.1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\" | sort -r"
```

The motherboard I'm using is adequate. Certainly the B450 chipset does the job just fine.


----------



## EvergreenSW (Aug 23, 2019)

DavidZemon said:


> You.
> Will.
> LOVE IT!



Exactly the feedback I was looking for 

I've been tossing up between the 3700x and the 8700k. Pros for the Intel would be familiarity (particularly with its behaviour in VirtualBox) and the integrated graphics which are plenty good enough for my needs. However as you've confirmed most compile tasks are going to scale very well across the extra cores of the 3700x, assuming they're properly parallelized of course. Good to know about the cooler, I'll budget for a decent quiet one.

Thanks!


----------



## DavidZemon (Aug 23, 2019)

EvergreenSW said:


> Exactly the feedback I was looking for
> 
> I've been tossing up between the 3700x and the 8700k. Pros for the Intel would be familiarity (particularly with its behaviour in VirtualBox) and the integrated graphics which are plenty good enough for my needs. However as you've confirmed most compile tasks are going to scale very well across the extra cores of the 3700x, assuming they're properly parallelized of course. Good to know about the cooler, I'll budget for a decent quiet one.
> 
> Thanks!



In case you had any doubts on virtualbox: I'm running Ubuntu 19.04 as my host and have two vbox VMs (one Win 7, another Win 10). Both booted up and ran exactly as expected after the CPU swap.

The video card thing caught me by surprise though.... I was looking so hard at the raw performance numbers that I forgot to confirm it had integrated graphics. I DO have a dedicated GPU, but I wasn't expecting to be relying on it ever... Oh well.

I just ran the following on my home PC and work PC to test single-threaded compile performance in a fashion that should be repeatable for you:


```
git clone https://github.com/kitware/cmake.git
cd cmake
git checkout v3.15.2
mkdir build
cd build
cmake ..
time make
```

On my home PC, with 3700x, DDR4 3000, and 2 TB Samsung 970 EVO: 4m1.885s
On my work PC, with 8700k, DDR4 2666, and a 512 GB Toshiba KXG50ZNV512G: 4m34.443s

I think this is just incredible. Even single-threaded performance, my home PC with AMD is winning.

Now, as fun as that was, I ran it again (make clean && time make -j<JOBS>) with parallel jobs...

Home: 0m30.048s
Work: 0m46.614s


----------

