Boost C++ Libraries Home Libraries People FAQ More

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 20.1. Compiler Option Comparison on Windows x64

Function

cl /Od (x86 build)

cl /arch:sse2 /Ox (x86 build)

cl /Ox (x64 build)

icl /Ox (x64 build)

boost::math::cbrt

18.29
(256ns)

4.29
(60ns)

3.14
(44ns)

1.00
(14ns)

boost::math::cyl_bessel_j (integer orders)

10.03
(742ns)

1.77
(131ns)

1.36
(101ns)

1.00
(74ns)

boost::math::ibeta_inv

4.32
(6583ns)

1.29
(1963ns)

1.28
(1957ns)

1.00
(1523ns)



PrevUpHomeNext