[cfe-users] Question casually profiling Clang vs GCC
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@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
Re: [cfe-users] Question casually profiling Clang vs GCC
On 01.08.2018 16:29, Jonas Toth via cfe-users wrote: > > very interesting. My experience with normal compilation is, that clang > is faster. Here's the data. It's from a single run each, so it's nowhere near a statistically sound sample. Package GCC Clang Difference dev-lang/python-2.7.152:31,640s 3:36,891s +43% app-arch/unzip-6.0_p21-r2 0:07,859s 0:10,094s +28% media-libs/opus-1.2.1 0:34,218s 0:46,750s +37% mail-mta/exim-4.91-r2 0:39,779s 0:54,672s +37% www-servers/nginx-1.12.2-r1 0:43,378s 1:03,537s +46% dev-db/postgresql-10.34:03,518s 6:14,859s +54% media-gfx/inkscape-0.92.228:21,146s 34:52,015s +23% > Could it be, that there are some precompiled headers or similar present > on the system, that GCC utilizes? That is possible. Where and how would I check that? Cheers, Florian ___ cfe-users mailing list cfe-users@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users