|
|
|
|
|
by phaedrus
3175 days ago
|
|
My experience with GCC and compiling C++ has been that performance scales nearly linearly with core count. In other words, compiling C++ gets great benefits from parallelism - provided you configure your build to take advantage of it. (For make use the -j N option where N=num cores + 1; for Code::Blocks it is a preferences option. Not sure about Visual Studio.) Things that do not parallelize: the final linking step (especially with mingw), compilation if all your code is one giant CPP file (prefer small files). Assuming you have an SSD, your project is configured for parallel build, and your code is organized into many small CPP files, more cores == more better. I look for the highest core count CPUs with the lowest power. Last year I built a dual CPU Xeon workstation / home server using 1.8 GHz 14-core chips (mostly from second-hand used hardware to save money). I feel that that low clock speed is actually an advantage, because even with 2 sockets and 8 sticks of 8 Gb RAM, it idles at only 75W (at the outlet, as measured with a Kill-a-Watt). With 56 total threads, it builds my C++ project in 2.0 seconds flat, something which takes almost 2 minutes single-threaded. (I think the fact that there are 60 seconds in a minute, that 56 ~= 60, and that the build time went from 2 minutes to 2 seconds is not coincidental.) Unfortunately a hardware problem with one of the used components seems to be causing the machine to lock up under Linux, and I never had the time to troubleshoot it, and moved on to a different codebase which doesn't require as much compilation so haven't yet had motivation to track down the problem. |
|