I did a comparison between blitz++, armadillo, boost::MultiArray with the following code (borrowed from an old post)
#include
using namespac
My test showed boost arrays had the same performance as the native/hardcoded C++ code.
You need to compare them using compiler optimisations activated. That is:
-O3
-DNDEBUG
-DBOOST_UBLAS_NDEBUG
-DBOOST_DISABLE_ASSERTS
-DARMA_NO_DEBUG
...
When I tested (em++), Boost performed at least 10X faster when you deactivate its asserts, enable level 3 optimisation using -O3
, etc. Any fair comparison should use these flags.