[cfe-dev] C++ Expression Template Benchmarks for GCC/Clang/Intel/PGI/MSVC

Walter Landry wlandry at caltech.edu
Thu Jun 14 15:54:09 PDT 2012

Hello Everyone,

I thought you might be interested in some C++ expression template
benchmarks I have done.


Clang's performance was mixed.  It optimized the expression template
code just as well as the code that unrolled the expressions by hand,
but that may be because it only did a mediocre job of optimizing the
unrolled versions.  GCC had similar performance issues until I used
-Ofast.  I could not find a similar option for Clang, partly because I
could not find a complete list of Clang compiler options.  You can see
a list of all of the compiler options that I used at


I used clang 3.0.  I also tried the 3.1 binary.  The difference in
performance was, on the whole, not significant.

Walter Landry
wlandry at caltech.edu

More information about the cfe-dev mailing list