performance_tests.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Performance Tests</title>
  5. <link rel="stylesheet" href="boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="index.html" title="Safe Numerics">
  8. <link rel="up" href="index.html" title="Safe Numerics">
  9. <link rel="prev" href="checked_integer_arithmetic.html" title="safe_compare&lt;T, U&gt;">
  10. <link rel="next" href="rationale.html" title="Rationale and FAQ">
  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 href="index.html" height="164px" src="pre-boost.jpg" alt="Library Documentation Index"></td>
  15. <td><h2>Safe Numerics</h2></td>
  16. </tr></table>
  17. <div class="spirit-nav">
  18. <a accesskey="p" href="checked_integer_arithmetic.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="rationale.html"><img src="images/next.png" alt="Next"></a>
  19. </div>
  20. <div class="section">
  21. <div class="titlepage"><div><div><h2 class="title" style="clear: both">
  22. <a name="safe_numerics.performance_tests"></a>Performance Tests</h2></div></div></div>
  23. <p>Our goal is to create facilities which make it possible to write
  24. programs known to be correct. But we also want programmers to actually use
  25. the facilities we provide here. This won't happen if using these
  26. facilities impacts performance to a significant degree. Although we've
  27. taken precautions to avoid doing this, the only real way to know is to
  28. create and run some tests.</p>
  29. <p>So far we've only run one explicit performance test -
  30. <code class="filename"><a href="../../test/test_performance.cpp" target="_top">test_performance.cpp</a></code>.
  31. This runs a test from the Boost Multiprecision library to count prime
  32. numbers and uses on integer arithmetic. We've run the tests with
  33. <code class="computeroutput">unsigned</code> integers and with <code class="computeroutput">safe&lt;unsigned&gt;</code>
  34. on two different compilers.. No other change was made to the program. We
  35. list the results without further comment.</p>
  36. <pre class="screen">g++ (GCC) 6.2.0
  37. Testing type unsigned:
  38. time = 17.6215
  39. count = 1857858
  40. Testing type safe&lt;unsigned&gt;:
  41. time = 22.4226
  42. count = 1857858
  43. clang-802.0.41
  44. Testing type unsigned:
  45. time = 16.9174
  46. count = 1857858
  47. Testing type safe&lt;unsigned&gt;:
  48. time = 36.5166
  49. count = 1857858
  50. </pre>
  51. </div>
  52. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  53. <td align="left"></td>
  54. <td align="right"><div class="copyright-footer">Copyright &#169; 2012-2018 Robert Ramey<p><a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">Subject to Boost
  55. Software License</a></p>
  56. </div></td>
  57. </tr></table>
  58. <hr>
  59. <div class="spirit-nav">
  60. <a accesskey="p" href="checked_integer_arithmetic.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="rationale.html"><img src="images/next.png" alt="Next"></a>
  61. </div>
  62. </body>
  63. </html>