Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
what's more important when it comes to compiling (hardware)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mightysilentsaint
n00b
n00b


Joined: 11 Aug 2018
Posts: 12

PostPosted: Sat Oct 06, 2018 6:27 am    Post subject: what's more important when it comes to compiling (hardware) Reply with quote

i've been using linux environments as my daily driver for the last 6 years starting with ubuntu when i was 14, moved to mint and used mint for 2 years then moved to arch and been using it ever since until i moved to gentoo 3 months ago.

i currently am using a g3258 overclocked to 4.2ghz core and 4ghz uncore, it has 2 cores and no ht/smt. it scores 4600 single and 7700 multi core on geekbench. it takes me 14 hours to completely install/compile my gentoo system, the entirety of it with every bit of software i need. i don't use firefox/chromium or libreoffice so it doesn't take a lot of time compared to the ones where said programs get compiled.

fx-6300 has 3 modules and each module contains 2 cores with every core having their individual l1 cache but l2 and l3 cache is shared. as bulldozer/vishera has really low ipc, it scores less than a 6-core chip on benchmarks, has really low single core score but has 6 threads. it scores around 2200 single and 7-8k multi-threaded on geekbench4, similar to my g3258 at 4.2/4ghz.

my question starts here, will it be beneficial to my compiling time if i were to change my setup to an fx-6300? it has 6 threads (4 threads more) but scores similar to my dual core chip. is thread count really important compared to overall multi-threaded performance? i don't have any multitasking problems with my dual core system as linux/unix-like environments aren't hard on system resources unlike windows, i rarely use more than 2.5 gigs of ddr3 so ram is not the issue here.

so, 6 threads with low-ipc cores with dumbed down cache and same multi core performance or 2 threads with high-ipc?
Back to top
View user's profile Send private message
Marcih
Apprentice
Apprentice


Joined: 19 Feb 2018
Posts: 152

PostPosted: Sat Oct 06, 2018 8:16 am    Post subject: Reply with quote

A short answer to your very long-winded question would be: We don't know.

A slightly longer answer would be:
There's simply no way for us to tell which one will be faster. Forget the synthetic benchmarks, forget the details, they are often not very telling of real-world performance beacuse so many variables come into play here (I/O speeds, how much free memory you have/amount of swapping done during compilation, the packages themselves that are being compiled, the alignment of the planets etc.) that even knowing what the world set compile time is for somebody else using the same processor is not much of an indicator.
My gut feeling would be that being able to run more jobs, accounting for the decrease of single-core performance, would be a benefit.

Here is my advice though: If you have access to both processors, set them up in a test machine with all the components the exact same (having an abundance of memory so you can write files during compile time to tmpfs would be a good idea to try and minimize potential I/O bottlenecks), install a very minimal installation of Gentoo (no X, the simplest Portage profile etc. Also, having the installs unique to the hardware by rebuiling the world set, or at least the toolchain, with march=native instead of using the generic binaries may make a difference) and test for yourself; either by rebuilding the entire world set or picking a large-ish package to measure its compile time. I've done tests like this with glibc, measured the time with genlop, I don't know whether there is a more common, "accepted" way to benchmark compile times.
_________________
Bones McCracker wrote:
It wouldn't be so bad, if it didn't suck.

===
I refuse to move on from GTK+2.
Back to top
View user's profile Send private message
joanandk
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2017
Posts: 85

PostPosted: Sat Oct 06, 2018 2:06 pm    Post subject: Re: what's more important when it comes to compiling (hardwa Reply with quote

mightysilentsaint wrote:
will it be beneficial to my compiling time if i were to change my setup to an fx-6300?


I have collected some non scientific experience (I said non scientific because I did not done reproducible setups, just talking from inner guts). I have seen that the compile time of a single core to n-core gets very fairly n times faster, if it is a real core. If you are using hyper-threading, then the advantage is 15% of a core+ht compared to core alone.

So if the package is able to multithread compile, you will see lower compile times. But be aware that there are packages which are not able to compile multithreaded, the download of the source is not accelerated AND (important) multithreading requires fairly big amount of RAM! On my 4-core+ht and 8GB, I cannot compile libreoffice with -j8 as I always run out of RAM and my system starts to swap (which slows down the the whole process).

So much to my non scientific experiences, I once wanted to do it correctly, but there are many factors which makes the whole setup complicated that I had to give up.

BR
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43425
Location: 56N 3W

PostPosted: Sat Oct 06, 2018 5:21 pm    Post subject: Reply with quote

mightysilentsaint,

Some things, like ./configure, are single threaded so the more cores you have the more waiting you have between configure steps when all but one core is idle.
That makes it appear bleaker that it is in reality, since emerge can run several jobs in parallel, dependencies permitting.

So much for cores, now RAM.
C++ can use over 1G RAM per thread, so to run eight C++ instances, you want >8G RAM.
You should also have /var/tmp/portage in tmpfs. There are lots of different ways to get 8 make jobs in parallel and the what's fastest will vary depending on what is possible.

With more cores working hard, you need more RAM, as being pushed into swapping and disk I/O in general wall slow you down, even if its an SSD.
Moving data around does not contribute to the end result.

The cache question is harder to answer. Cache thrashing, because not everything fits in the CPU cache certainly leads to slowdowns.
So do all the workarounds for meltdown and spectre, which effectively turn off the affected processor features, some of which helped with cache prefetch.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1752

PostPosted: Sat Oct 06, 2018 5:36 pm    Post subject: Re: what's more important when it comes to compiling (hardwa Reply with quote

mightysilentsaint wrote:
(...)
i currently am using a g3258 overclocked to 4.2ghz core and 4ghz uncore, it has 2 cores and no ht/smt.(..) and 7700 multi core on geekbench

fx-6300 has 3 modules and each module contains 2 cores with every core having their individual l1 cache but l2 and l3 cache is shared. (...) it scores around (...) 7-8k multi-threaded on geekbench4, similar to my g3258 at 4.2/4ghz.

my question starts here, will it be beneficial to my compiling time if i were to change my setup to an fx-6300? (...)

Based on your benchmark: No.
There is basically a tie on multicore performance, so you probably won't see any difference in case of building big packages / multiple packages at the same time.
There is a big difference in single-core performance, so stick with fewer, but more powerful cores you already have.
Tasks are interleaved anyway, so you can run 6 tasks on 2 cores, but you can't fully load 6 cores with 2 tasks.
Back to top
View user's profile Send private message
msst
Apprentice
Apprentice


Joined: 07 Jun 2011
Posts: 219

PostPosted: Sun Oct 07, 2018 5:24 pm    Post subject: Reply with quote

Quote:
Some things, like ./configure, are single threaded so the more cores you have the more waiting you have between configure steps when all but one core is idle.
That makes it appear bleaker that it is in reality, since emerge can run several jobs in parallel, dependencies permitting.


Exactly my experience. On an now getting older i7 with 4 cores and 8 hyperthreads for the majority of small projects the emerge and configure overhead beats the compile time. Exception are the big projects that get more stuck on the processing power.

The latter will benefit from having more cores. The former not so much. Ideally you have both, high single core performance and many cores...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum