Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Performance

By and large the performance of this library should be acceptable for most needs. However, often the library has to make a choice whether to be accurate or fast and by default it chooses accuracy over speed. If you would rather have fast rather than fully accurate routines, then refer to the performance section for information and examples on how to achieve this.

In terms of the algorithms used, this library aims to use the same "best of breed" algorithms as many other libraries: the principle difference is that this library is implemented in C++ - taking advantage of all the abstraction mechanisms that C++ offers - where as most traditional numeric libraries are implemented in C or FORTRAN. Traditionally languages such as C or FORTRAN are perceived as easier to optimise than more complex languages like C++, so in a sense this library provides a good test of current compiler technology, and the "abstraction penalty" - if any - of C++ compared to other languages.

The three most important things you can do to ensure the best performance from this library are:

  1. Turn on your compilers optimisations: the difference between "release" and "debug" builds can easily be a factor of 20.
  2. Pick your compiler carefully: performance differences of up to 8 fold have been found between some Windows compilers for example.
  3. Disable internal use of long double, this will reduce accuracy but typically yield a 2x speedup on modern x64 hardware/compilers.

The performance section contains more information on the performance of this library, what you can do to fine tune it, and how this library compares to some other open source alternatives.


PrevUpHomeNext