Reputation: 70145
I'm seeing a factor of four slowdown in Clang compilation versus GCC. Any idea what causes this?
ebg@tsuki(250)$ time /usr/bin/cc -DHC4 -DSAFETY -DNOREDUCE -DNFAIR=3 -O2 -o files2 pan.c
real 2m3.073s
user 1m59.484s
sys 0m3.585s
ebg@tsuki(251)$ time /usr/local/gcc/bin/gcc -DHC4 -DSAFETY -DNOREDUCE -DNFAIR=3 -O2 -o files1 pan.c
real 0m28.310s
user 0m27.590s
sys 0m0.706s
ebg@tsuki(252)$ /usr/bin/cc -v
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix
ebg@tsuki(253)$ /usr/local/gcc/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc/libexec/gcc/x86_64-apple-darwin10.7.0/4.6.0/lto-wrapper
Target: x86_64-apple-darwin10.7.0
Configured with: ./configure --prefix=/usr/local/gcc --enable-languages='c c++' --enable-lto --with-gmp=/usr/local/gcc --with-mpfr=/usr/local/gcc --with-mpc=/usr/local/gcc
Thread model: posix
gcc version 4.6.0 (GCC)
Upvotes: 3
Views: 1043
Reputation: 1894
When I had the same problem it was due to clang was build for debug mode and not for release mode.
Upvotes: 3