clang's build performance

"René J.V. Bertin" rjvbertin at gmail.com
Sat Jul 5 06:08:06 PDT 2014


In hope it's not completely out of place to discuss this here, but has anyone else noticed that clang's supposedly better build performance (as opposed to gcc) is no longer an accurate selling argument, at least for version 3.4? 

Comparing build times of a port I'm working on, KDE's rekonq so mostly C++:

> port clean rekonq ; time port -v destroot rekonq # uses Apple's gcc-4.2 on OS X 10.6.8
2:59 total_time
> port clean rekonq ; time port -v destroot rekonq configure.compiler=clang # uses Apple's clang-3.0 on OS X 10.6.8
1:42 total_time
> port clean rekonq ; time port -v destroot rekonq configure.compiler=macports-clang-3.4
4:04 total_time
> port clean rekonq ; time port -v destroot rekonq configure.compiler=macports-gcc-4.8
2:22 total_time

That's on an i7 with 2 cores x 2 hyperthreads; I'm getting in a bit over 200% CPU when using 4 concurrent build jobs.

I haven't yet done a similar comparison under Linux, but could this be due to how MacPort's llvm & clang are built?


More information about the macports-users mailing list