I picked a bunch of test packages, ebuild fetched and ebuild unpacked them, then I timed ebuild compile first with sys-devel/gcc-7.3.0-r3 and then again with sys-devel/clang-5.0.2.
To enable Clang, I did the simplest thing and set
Code: Select all
CC="clang"
CXX="clang++"
CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -fno-lto"
#XXFLAGS="${CXXFLAGS} -fno-lto"To my surprise, Clang took between +28% (app-arch/unzip) and +54% (dev-db/postgresql) more compile time, with a median increase of +40%.
Word has it that Clang compiles faster than GCC in the wild. What could be a reason that it consistently performs so much slower on my machine? Did I forget to set up something that is required? I'll also gladly provide more information.



