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

Getting the Best Performance from this Library: Compiler and Compiler Options

By far the most important thing you can do when using this library is turn on your compiler's optimisation options. As the following table shows the penalty for using the library in debug mode can be quite large. In addition switching to 64-bit code has a small but noticeable improvement in performance, as does switching to a different compiler (Intel C++ 15 in this example).

Table 23.1. Compiler Option Comparison on Windows x64

Function

cl /Od (x86 build)

cl /arch:sse2 /Ox (x86 build)

cl /Ox (x64 build)

boost::math::cbrt

5.05
(202ns)

1.20
(48ns)

1.00
(40ns)

boost::math::cyl_bessel_j (integer orders)

4.38
(530ns)

1.00
(121ns)

1.02
(124ns)

boost::math::ibeta_inv

4.52
(8277ns)

1.11
(2042ns)

1.00
(1833ns)



PrevUpHomeNext