Jump to content

Hello!

 

I've been looking into upgrading my computer, and the CPU is the main thing I'm stuck thinking about. Currently, I do a lot of compiling on my computer(Java, Android), and I really want to increase the speed of that as much as possible. However, a lot of the benchmarks that are out there for CPUs are either targeted towards video editing, or games, or are just artificial benchmarks.

 

I'm wondering if anyone would have any knowledge on how well compilers scale with multiple cores/threads. I have my doubts than more than 4 cores would really make any significant difference, but it would be interesting to know for certain.

 

So, what do you think?

 

Would it be better to go with something like a i7-6700K, a i7-5930K, or would it be worthwhile to rock dual Xeon E3-1276 v3?

 

Thanks!

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/
Share on other sites

Link to post
Share on other sites

Depends on size of project. 

 

 

If your gonna make the next Google Chrome a Xeon would be quite nice. If not then a core i5 or i7 desktop would work just fine.

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-6494041
Share on other sites

Link to post
Share on other sites

Hello!

 

I've been looking into upgrading my computer, and the CPU is the main thing I'm stuck thinking about. Currently, I do a lot of compiling on my computer(Java, Android), and I really want to increase the speed of that as much as possible. However, a lot of the benchmarks that are out there for CPUs are either targeted towards video editing, or games, or are just artificial benchmarks.

 

I'm wondering if anyone would have any knowledge on how well compilers scale with multiple cores/threads. I have my doubts than more than 4 cores would really make any significant difference, but it would be interesting to know for certain.

 

So, what do you think?

 

Would it be better to go with something like a i7-6700K, a i7-5930K, or would it be worthwhile to rock dual Xeon E3-1276 v3?

 

Thanks!

Welcome to LTT forums, read CoC. And make sure to follow your posts!

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-6494047
Share on other sites

Link to post
Share on other sites

Moved to CPUs, Motherboards, and Memory.

"It pays to keep an open mind, but not so open your brain falls out." - Carl Sagan.

"I can explain it to you, but I can't understand it for you" - Edward I. Koch

"I didn't die! I performed a tactical reset!" - Apollolol

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-6494217
Share on other sites

Link to post
Share on other sites

i do not know how many cores a compiler program can utilize. However if it is more then 4 cores, then AMDs FX series may be a good budget option, while the 5920k would be a good "top end" option.

@patrickjp93

that guy prolly knows more about core usage of your average compiler program then i do.

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-6494284
Share on other sites

Link to post
Share on other sites

If you program in an IDE, then there are usually options to activate parallel compiling. Sticking point? If you have a deep inheritance tree that doesn't have a good branching factor, parallel compiling will get you nowhere. Lots of independent classes with 1 main that makes use of them? Parallel compiling scales almost perfectly. The Java compiler is not one I'm particularly familiar with, but Oracle isn't a slouch when it comes to software development and in fact builds some of the highest core-count CPUs in the world. If you use a text editor and call the compiler, there's probably a flag for parallel compiling.

As per compiler benchmarks, there may be Java variants of the ones used to compare GCC and Clang both on performance and compile time. Start there.

Software Engineer for Suncorp (Australia), Computer Tech Enthusiast, Miami University Graduate, Nerd

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-6494436
Share on other sites

Link to post
Share on other sites

Hey, First off java does not technically compile in the normal sense.

 

It compiles to bytecode which both gcc/clang can use.

 

You can use pretty much any compiler, I'd recommend openjdk/jre and your regular gcc/clang as they are the best compilers.

 

Now I've been reading, and from experience, unless you're writing massive code that's specific to one set of instructions.

 

You can use anything, cores don't matter when compiling.

 

The compiler's job is to read your code, verify it's syntax and assemble it in bytecode.

 

Personally any cpu will do.

 

You do not get any linear improvement when compiling when using more cores.

 

 

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-6495432
Share on other sites

Link to post
Share on other sites

If you program in an IDE, then there are usually options to activate parallel compiling. Sticking point? If you have a deep inheritance tree that doesn't have a good branching factor, parallel compiling will get you nowhere. Lots of independent classes with 1 main that makes use of them? Parallel compiling scales almost perfectly. The Java compiler is not one I'm particularly familiar with, but Oracle isn't a slouch when it comes to software development and in fact builds some of the highest core-count CPUs in the world. If you use a text editor and call the compiler, there's probably a flag for parallel compiling.

As per compiler benchmarks, there may be Java variants of the ones used to compare GCC and Clang both on performance and compile time. Start there.

He's writing java not assembly, I don't think he'll be writing algorithms that need such speed and branch predictability in java any way.

You're probably going to write that in c and assembly.

 

There are jvms that can handle a massive amount of ram and cores but they don't matter to normal developers and the regular jvm doesn't need anything extravagant.

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-6495462
Share on other sites

Link to post
Share on other sites

Java uses 1 core for compilation. Junit can run in parallel but the JVM compilation process is limited to a single core and once you have an ssd you will find it scales with clockspeed.The cores are useful for other reasons (profilers, the app itself, your database etc) but directly for compilation of Java and android its not helpful.

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-6496505
Share on other sites

Link to post
Share on other sites

Thanks for all the quick replies, all of them are super helpful!

 

It seems the general consensus is that more cores does not really help in this situation. So, I guess I'll have to look into getting just an i7, and overclock that. Kind of sucks though, as if running dual Xeons would have helped a lot, that would be a very fun rig to build. Oh well.

 

Would this be a good place for Skylake? As I've heard it's per core performance is better than last gen's.

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-6499631
Share on other sites

Link to post
Share on other sites

  • 3 years later...

Sorry for posting on this old thread but I cannot let the LogicalDesign's conclusion be the last post in this thread. I want to fix this as I was also looking for benchmarking around compiling and this thread came up first on my google search. So I want to help other who stumble on this thread and leave better informed. Many new programmers get into programming focus on writing code and it takes a while for them to understand how their code then becomes binary executables or libraries. Is a good thing to know, which I won't fully explain as there's plenty of other resources, but many programmers can probably become relatively successful without knowing.

 

TLDR:

Hell YES! More cores can help with compile time.

 

Longer version:

Clock speed definitely help compile time. However core count will very likely help compile time even more but there's a couple of condition. 

  1. The language and compiler you are using (does the compiler support parallel optimization)
    1. Compiling time is a problem many people are working on and higher clock speed is one of many ways. At some point (well before this thread even started) there were several walls cpu companies faced with increasing clock speed, to name a few stability, heat, power consumption, laws of physics. So utilizing multiple cores for faster compiling became A method to decrease compiling time.
  2. Number for files involved in your projects
    1. How do more cores help? For C and C++  projects with multiple files, each file needs to be compile which generates and object file. Once they are all created a linker will more or less combine they parts to create your binary. Hopefully from this oversimplified explanation you can see how the files and be distributed to multiple core (for gcc these are called jobs). And I'm sure other compilers for other languages operate similarly as well including java. 
  3. If you're compiling from scratch vs recompiling a single file (or few)
    1. There's another optimization scheme where the compiler will cache your your previous compiled code (objects) and reuse them for future build if the code for those has not changed. Thus only compile file which has changed. So if you only changed one file or a few, you might not see much benefits from more cores.
  4. Whether your IDE is using the compiler option to build in parallel.
    1. Most if not all modern compiler will have parallelism optimization but some will need to be implicitly configured to do so. If you're using an IDE there's likely an option for it, but not always.

 

I'm sure there's more points and I might be wrong a few thing but the believe in what I laid out is generally correct. While more cores is generally better you need to consider the cpu as a whole and probably the entire machine. Hope this helps new programmers young and old alike.

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-12536426
Share on other sites

Link to post
Share on other sites

Just now, pjv2500 said:

Sorry for posting on this old thread but I cannot let the LogicalDesign's conclusion be the last post in this thread. I want to fix this as I was also looking for benchmarking around compiling and this thread came up first on my google search. So I want to help other who stumble on this thread and leave better informed. Many new programmers get into programming focus on writing code and it takes a while for them to understand how their code then becomes binary executables or libraries. Is a good thing to know, which I won't fully explain as there's plenty of other resources, but many programmers can probably become relatively successful without knowing.

 

TLDR:

Hell YES! More cores can help with compile time.

 

Longer version:

Clock speed definitely help compile time. However core count will very likely help compile time even more but there's a couple of condition. 

  1. The language and compiler you are using (does the compiler support parallel optimization)
    1. Compiling time is a problem many people are working on and higher clock speed is one of many ways. At some point (well before this thread even started) there were several walls cpu companies faced with increasing clock speed, to name a few stability, heat, power consumption, laws of physics. So utilizing multiple cores for faster compiling became A method to decrease compiling time.
  2. Number for files involved in your projects
    1. How do more cores help? For C and C++  projects with multiple files, each file needs to be compile which generates and object file. Once they are all created a linker will more or less combine they parts to create your binary. Hopefully from this oversimplified explanation you can see how the files and be distributed to multiple core (for gcc these are called jobs). And I'm sure other compilers for other languages operate similarly as well including java. 
  3. If you're compiling from scratch vs recompiling a single file (or few)
    1. There's another optimization scheme where the compiler will cache your your previous compiled code (objects) and reuse them for future build if the code for those has not changed. Thus only compile file which has changed. So if you only changed one file or a few, you might not see much benefits from more cores.
  4. Whether your IDE is using the compiler option to build in parallel.
    1. Most if not all modern compiler will have parallelism optimization but some will need to be implicitly configured to do so. If you're using an IDE there's likely an option for it, but not always.

 

I'm sure there's more points and I might be wrong a few thing but the believe in what I laid out is generally correct. While more cores is generally better you need to consider the cpu as a whole and probably the entire machine. Hope this helps new programmers young and old alike.

This is like 4 years old OP is not gonna see your response

✧・゚: *✧・゚:*  Quote for a reply  *:・゚✧*:・゚✧

 

✧・゚: *✧・゚:*   Ask for discord   *:・゚✧*:・゚✧

Link to comment
https://linustechtips.com/topic/484121-best-cpu-for-compiling/#findComment-12536431
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×