Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-09-12 11:25:18

Last week, we were considering using the parameter library in some
client software that demands high performance (they are doing
massively parallel statistical analysis), so I sat with Matthias
Troyer, an expert in high-performance C++, and developed the test
that's now checked in at libs/parameter/test/efficiency.cpp. The test
was carefully designed to avoid deceptive effects due to dead code
elimination, constant propagation, and CPU architecture, and the
process of developing it was highly instructive to me personally. We
left lots of comments in the code so I'd be able to remember the
issuse involved. I recommend reviewing it for anyone interested in
how to measure abstraction penalty. One set of results is checked in
at libs/parameter/test/timings.txt, and are reproduced below.

As you can see, at least on that platform, you don't need to worry
about Boost.Parameter slowing your code down; it might even speed your
code up!

We'd be very interested in seeing results produced with other
compilers and/or platforms at the highest optimization levels.

----------------- Test #1 ----------------
  Matthias Troyer, Michael Gauckler, David Abrahams


  Cygwin g++-4.0.0

Command lines:
  g++ -c -o efficiency.o -ftemplate-depth-100 -funroll-loops \
      -O3 -finline-functions -Wno-inline -DNDEBUG efficiency.cpp

  g++ -o efficiency.exe efficiency.o -Wl,--strip-all

  efficiency && efficiency && efficiency

  Dell Inspiron 9300
  Intel(R) Pentium(R) M processor 2.00GHz
  Running on 230 volts AC power

  Run #1 results discarded per standard practice

  Run #2
  plain time: 0.75
  named parameter time: 0.734

  Run #3
  plain time: 0.781
  named parameter time: 0.766


Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at