getting_best.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  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.11.0">
  8. <link rel="up" href="../perf.html" title="Chapter&#160;21.&#160;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&#160;21.1.&#160;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. <col>
  46. </colgroup>
  47. <thead><tr>
  48. <th>
  49. <p>
  50. Function
  51. </p>
  52. </th>
  53. <th>
  54. <p>
  55. cl /Od (x86 build)
  56. </p>
  57. </th>
  58. <th>
  59. <p>
  60. cl /arch:sse2 /Ox (x86 build)
  61. </p>
  62. </th>
  63. <th>
  64. <p>
  65. cl /Ox (x64 build)
  66. </p>
  67. </th>
  68. <th>
  69. <p>
  70. icl /Ox (x64 build)
  71. </p>
  72. </th>
  73. </tr></thead>
  74. <tbody>
  75. <tr>
  76. <td>
  77. <p>
  78. boost::math::cbrt
  79. </p>
  80. </td>
  81. <td>
  82. <p>
  83. <span class="red">18.29<br> (256ns)</span>
  84. </p>
  85. </td>
  86. <td>
  87. <p>
  88. <span class="red">4.29<br> (60ns)</span>
  89. </p>
  90. </td>
  91. <td>
  92. <p>
  93. <span class="red">3.14<br> (44ns)</span>
  94. </p>
  95. </td>
  96. <td>
  97. <p>
  98. <span class="green">1.00<br> (14ns)</span>
  99. </p>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td>
  104. <p>
  105. boost::math::cyl_bessel_j (integer orders)
  106. </p>
  107. </td>
  108. <td>
  109. <p>
  110. <span class="red">10.03<br> (742ns)</span>
  111. </p>
  112. </td>
  113. <td>
  114. <p>
  115. <span class="blue">1.77<br> (131ns)</span>
  116. </p>
  117. </td>
  118. <td>
  119. <p>
  120. <span class="blue">1.36<br> (101ns)</span>
  121. </p>
  122. </td>
  123. <td>
  124. <p>
  125. <span class="green">1.00<br> (74ns)</span>
  126. </p>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td>
  131. <p>
  132. boost::math::ibeta_inv
  133. </p>
  134. </td>
  135. <td>
  136. <p>
  137. <span class="red">4.32<br> (6583ns)</span>
  138. </p>
  139. </td>
  140. <td>
  141. <p>
  142. <span class="blue">1.29<br> (1963ns)</span>
  143. </p>
  144. </td>
  145. <td>
  146. <p>
  147. <span class="blue">1.28<br> (1957ns)</span>
  148. </p>
  149. </td>
  150. <td>
  151. <p>
  152. <span class="green">1.00<br> (1523ns)</span>
  153. </p>
  154. </td>
  155. </tr>
  156. </tbody>
  157. </table></div>
  158. </div>
  159. <br class="table-break">
  160. </div>
  161. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  162. <td align="left"></td>
  163. <td align="right"><div class="copyright-footer">Copyright &#169; 2006-2019 Nikhar
  164. Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
  165. Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
  166. R&#229;de, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
  167. Daryle Walker and Xiaogang Zhang<p>
  168. Distributed under the Boost Software License, Version 1.0. (See accompanying
  169. 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>)
  170. </p>
  171. </div></td>
  172. </tr></table>
  173. <hr>
  174. <div class="spirit-nav">
  175. <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>
  176. </div>
  177. </body>
  178. </html>