Using the new clang driver

Hi,

I tested the new clang driver, and I am very pleased with the results.
Nice job!

Here are the results when building ClamAV with a default ./configure
(which sets CFLAGS to -O2 -g),
and running time make -j4 >/dev/null:

gcc-4.3: real 0m19.615s user 0m53.727s sys 0m5.800s
ccc: real 0m16.736s user 0m39.726s sys 0m7.596s
clang: real 0m13.786s user 0m33.142s sys 0m5.136s
llvm-gcc: real 0m13.046s user 0m32.662s sys 0m5.332s
ccache+gcc: real 0m4.703s user 0m6.936s sys 0m3.380s

As you can see clang is now almost as fast llvm-gcc, and definitely
faster than gcc, and the old ccc driver.
I'm a bit surprised that clang isn't faster than llvm-gcc, but I think
most of the time is spent in the optimizers/codegen
and not in parsing (this is a C application, includes are not as huge as
for C++).

Best regards,
--Edwin

why real is shorter than sys in the result of time?

2009/3/29 Török Edwin <edwintorok@gmail.com>

polarj wrote:

why real is shorter than sys in the result of time?

Highly parallelized building.

Sebastian

Yes, this was run on a Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz,
with make -j4.

Best regards,
--Edwin

Thanks, I forgot it.

And I try your test with clang too, but it’s seems clang is slower than gcc. I just svn update last night from trunk. You said it’s the new clang driver, and how can I get it?

Thanks

2009/3/29 Sebastian Redl <sebastian.redl@getdesigned.at>

2009/3/29 Xiaotian Zhang <zhpalt@gmail.com>

Thanks, I forgot it.

And I try your test with clang too, but it’s seems clang is slower than gcc. I just svn update last night from trunk. You said it’s the new clang driver, and how can I get it?

The new clang driver is what is now the “clang” executable. When you are comparing clang to gcc, are you using a Release-Asserts build (i.e., “make ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1”)? If not that is probably the answer. Otherwise if you feel like investigating further feel free to file performance related bugs.

  • Daniel