Expression Templates Revisited: Separating Facts from Urban Legends

Since their invention in 1995, Expression Templates (ETs) have proven to be a valuable tool for many C++ template libraries. Especially numerics libraries quickly embraced them as salvation for the performance deficiencies of standard C++. This reputation as performance optimization quickly added to the success of ETs and lead to a general adoption of the technique.

However, some of the "well-known" facts about expression templates prove to be urban legends that are unfortunately dangerously misleading. In certain communities they even contribute to severely discredit C++ in general. In this talk I will put several statements about ETs in the spotlight and re-evaluate them in the context of the most widely used, ET-based math libraries: the ET
pioneer Blitz++, the Boost uBLAS library, MTL4, Eigen3, and Blaze. Specifically, I will put the following statements to the test:

  • ETs are easy to use and apply
  • ETs are easy to maintain
  • ETs are a performance optimization
  • ETs help the compiler to produce optimized code
  • ETs are easily parallelized
  • ETs are obsolete due to C++11 move semantics

Speaker: Klaus Iglberger

Slides: Expression Templates Revisited


Go back