Monday, June 6, 2016

Multithreaded linking with, currently minimal benefit

When properly using ‘make’ with a large development tress, I generally find the single largest bottleneck during compilation quickly becomes the linking stage. While most distributions, including CentOS 7, now include for a substantially performance boost over the traditional ld, faster performance would always be benefitial. Imagine my excitement when I learned that has a multithreaded mode as a possible way in increase speed without new hardware!  However by default (part of binutils) is built with it disabled under Centos 7 --threads warning: ignoring --threads: was compiled without thread support
GNU gold (version 20130226) 1.11
Originally I though this entry would end up being a recipe on how to rebuild binutils from an srpm with the “--enable-threads” to enable multithreaded. Unfortunately, after testing this myself and some informal benchmarking with 4 threads, the actually speed increase was only about 1-2% - not worth the possible side effects in my opinion. That said the version of binutils/gold included with CentOS 7 is heavily patched and a few versions behind, so it’s possible a newer/vanilla version of might benefit greater benefit in threaded mode. In particular devtoolsset-4 from Software Collection comes with a more vanilla 2.25, so once I’m ready to move to gcc 5.2 I might conduct this experiment again.  Finally, if you have seen differnet behavior with multithreaded I would love to hear about it.

No comments:

Post a Comment