[LLVM v3.8.0rc3] cmake-2.8.12: Statistics gcc-4.9 VS. clang-3.8

Hi,

here some statistics when building LLVM v3.8.0rc3 with CMAKE and GCC
v4.9.2 or CLANG v3.8.0rc3 here on my Ubuntu/precise AMD64 system.

[ THE GOOD (disc-usage) ]

Compiling with clang-3.8 produces smaller binaries VS. gcc-4.9
(approx. 250MiB smaller).
Checking with 'wc -l' shows 1893 files in total for both install-dirs.

$ cd /opt ; du -s -m llvm-toolchain-3.8.0rc3_*
609 llvm-toolchain-3.8.0rc3_clang-compiled
864 llvm-toolchain-3.8.0rc3_gcc-compiled

$ LC_ALL=C wc -l ls-lR_*.txt
  1893 ls-lR_clang-compiled.txt
  1893 ls-lR_gcc-compiled.txt
  3786 total

[ THE BAD (build-time) ]

Build-time increased approx. 1h from 2 to 3 hours when using CMAKE
instead of CONFIGURE/MAKE (logs deleted for LLVM v3.8.0rc2).
Building always done with one single parallel-compile-jobs.
When using CMAKE $COMPILER does not matter, it's approx. 3 hours build-time.

$ cat statistics/3.8.0rc3*/build*.txt

-rw-r--r-- 1 wearefam wearefam 138872 Feb 25 10:25
logs/3.8.0rc3_clang-compiled/install-log_llvm-toolchain-3.8.0rc3.txt
-rw-r--r-- 1 wearefam wearefam 216544 Feb 25 10:22
logs/3.8.0rc3_clang-compiled/build-log_llvm-toolchain-3.8.0rc3.txt
-rw-r--r-- 1 wearefam wearefam 14476 Feb 25 07:29
logs/3.8.0rc3_clang-compiled/configure-log_llvm-toolchain-3.8.0rc3.txt

-rw-r--r-- 1 wearefam wearefam 138872 Feb 24 18:55
logs/3.8.0rc3_gcc-compiled/install-log_llvm-toolchain-3.8.0rc3.txt
-rw-r--r-- 1 wearefam wearefam 344202 Feb 24 18:45
logs/3.8.0rc3_gcc-compiled/build-log_llvm-toolchain-3.8.0rc3.txt
-rw-r--r-- 1 wearefam wearefam 14295 Feb 24 15:53
logs/3.8.0rc3_gcc-compiled/configure-log_llvm-toolchain-3.8.0rc3.txt

[ AND THE UGLY ]

/me or my attached build-script?

I have not tried NINJA with CMAKE v3.x in combinations with
parallel-compile-jobs >=1.
My Samsung Ultrabook should do 5 compile-jobs in parallel.

Hope this helps a bit.

Regards,
- Sedat -

[1] The Good, the Bad and the Ugly - Wikipedia

build_llvm-toolchain.sh (3.74 KB)

Are you sure that you are actually using equivalent settings? cmake vs
manual Makefiles should have at most a few percent performance impact
for a full build on moderate concurrent load. It should certainly not be
a factor of 2 or 3.

Joerg