1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Getting the Best Performance from this Library: Compiler and Compiler Options</title> 5<link rel="stylesheet" href="../math.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../index.html" title="Math Toolkit 2.12.0"> 8<link rel="up" href="../perf.html" title="Chapter 22. Performance"> 9<link rel="prev" href="interp.html" title="Interpreting these Results"> 10<link rel="next" href="tradoffs.html" title="Trading Accuracy for Performance"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="interp.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../perf.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tradoffs.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 27<a name="math_toolkit.getting_best"></a><a class="link" href="getting_best.html" title="Getting the Best Performance from this Library: Compiler and Compiler Options">Getting the Best Performance 28 from this Library: Compiler and Compiler Options</a> 29</h2></div></div></div> 30<p> 31 By far the most important thing you can do when using this library is turn 32 on your compiler's optimisation options. As the following table shows the penalty 33 for using the library in debug mode can be quite large. In addition switching 34 to 64-bit code has a small but noticeable improvement in performance, as does 35 switching to a different compiler (Intel C++ 15 in this example). 36 </p> 37<div class="table"> 38<a name="math_toolkit.getting_best.table_Compiler_Option_Comparison_on_Windows_x64"></a><p class="title"><b>Table 22.1. Compiler Option Comparison on Windows x64</b></p> 39<div class="table-contents"><table class="table" summary="Compiler Option Comparison on Windows x64"> 40<colgroup> 41<col> 42<col> 43<col> 44<col> 45</colgroup> 46<thead><tr> 47<th> 48 <p> 49 Function 50 </p> 51 </th> 52<th> 53 <p> 54 cl /Od (x86 build) 55 </p> 56 </th> 57<th> 58 <p> 59 cl /arch:sse2 /Ox (x86 build) 60 </p> 61 </th> 62<th> 63 <p> 64 cl /Ox (x64 build) 65 </p> 66 </th> 67</tr></thead> 68<tbody> 69<tr> 70<td> 71 <p> 72 boost::math::cbrt 73 </p> 74 </td> 75<td> 76 <p> 77 <span class="red">5.05<br> (202ns)</span> 78 </p> 79 </td> 80<td> 81 <p> 82 <span class="green">1.20<br> (48ns)</span> 83 </p> 84 </td> 85<td> 86 <p> 87 <span class="green">1.00<br> (40ns)</span> 88 </p> 89 </td> 90</tr> 91<tr> 92<td> 93 <p> 94 boost::math::cyl_bessel_j (integer orders) 95 </p> 96 </td> 97<td> 98 <p> 99 <span class="red">4.38<br> (530ns)</span> 100 </p> 101 </td> 102<td> 103 <p> 104 <span class="green">1.00<br> (121ns)</span> 105 </p> 106 </td> 107<td> 108 <p> 109 <span class="green">1.02<br> (124ns)</span> 110 </p> 111 </td> 112</tr> 113<tr> 114<td> 115 <p> 116 boost::math::ibeta_inv 117 </p> 118 </td> 119<td> 120 <p> 121 <span class="red">4.52<br> (8277ns)</span> 122 </p> 123 </td> 124<td> 125 <p> 126 <span class="green">1.11<br> (2042ns)</span> 127 </p> 128 </td> 129<td> 130 <p> 131 <span class="green">1.00<br> (1833ns)</span> 132 </p> 133 </td> 134</tr> 135</tbody> 136</table></div> 137</div> 138<br class="table-break"> 139</div> 140<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 141<td align="left"></td> 142<td align="right"><div class="copyright-footer">Copyright © 2006-2019 Nikhar 143 Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, 144 Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan 145 Råde, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, 146 Daryle Walker and Xiaogang Zhang<p> 147 Distributed under the Boost Software License, Version 1.0. (See accompanying 148 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 149 </p> 150</div></td> 151</tr></table> 152<hr> 153<div class="spirit-nav"> 154<a accesskey="p" href="interp.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../perf.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tradoffs.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 155</div> 156</body> 157</html> 158