[cfe-users] Question casually profiling Clang vs GCC

Florian Berger via cfe-users cfe-users at lists.llvm.org
Wed Aug 1 04:23:33 PDT 2018


Hi,

I am a long term Gentoo Linux user, which, as a source-based meta
distribution, involves frequent (re-)compilation of a lot of packages
from scratch.

Curious how Clang would perform against the system's gcc-7.3.0-r3 in
terms of compilation speed, I installed clang-5.0.2 (latest stable on
Gentoo) and compiled a handful of random packages: Python, unzip,
libopus, exim, nginx, postresql. Setting was -O2, LTO was disabled.

Surprisingly, Clang consistently took considerably longer to compile
these packages than GCC, ranging from +28% (unzip) to +54% (postgresql),
with a median increase of +40% in compile time. That contradicts the
notion that Clang would be on par or quicker than GCC in terms of
compilation time.

Is that expected behaviour? May I have been missing some vital switch or
setup?

Any hints appreciated, and I'll gladly provide more information.

Kind regards,

Florian



More information about the cfe-users mailing list