[cfe-dev] clang vs gcc on ROOT...

Fons Rademakers Fons.Rademakers at cern.ch
Fri Oct 22 12:35:20 PDT 2010


Hi,

   as clang++ can now compile the entire ROOT framework (~3MLOC++, used for 
analysis of CERN LHC data) without errors in -O2 mode, it is time for some 
first benchmarks. Just the fact that clang compiles and runs in optimized 
mode is an impressive feat for such a young product, especially compared to 
mature compilers like gcc, icc and msvc.

Basically clang compiles up to 40% faster, produces executables that run 
with basically equal performance while the produced binaries are about 10% 
larger. Not speaking about the much better warning and error messages.
Looking forward to some more optimization performance gains.

Cheers, Fons.

-------------------------------------------------------------------------
       clang vs gcc performance on ROOT using -O2 (on 8-core MacPro)

                        clang                       gcc

compile time        real    5m17.573s            real    7m32.708s
make -j 8           user    29m2.199s            user    38m0.975s
                     sys     3m25.704s            sys     5m48.643s

benchmarks.C        1751.81                      1777.46
in rootmarks
(higher is better)

stress -b 30        2342.9                       2357.4
in rootmarks

stressHepix         2226.1 rootmarks             2175.7 rootmarks
                     real 211.6                   real 215.8
                     cpu  125.2                   cpu  128.1

size of binary      111448                       102328
du -sk lib


-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers at cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640



More information about the cfe-dev mailing list