[cfe-users] Question casually profiling Clang vs GCC

Jonas Toth via cfe-users cfe-users at lists.llvm.org
Wed Aug 1 07:29:41 PDT 2018


very interesting. My experience with normal compilation is, that clang
is faster.

Could it be, that there are some precompiled headers or similar present
on the system, that GCC utilizes?

Best Regards, Jonas

Am 01.08.2018 um 13:23 schrieb Florian Berger via cfe-users:
> 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
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

More information about the cfe-users mailing list