3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>Rational Type Performance
</title>
5 <link rel=
"stylesheet" href=
"../../../../../../doc/src/boostbook.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.77.1">
7 <link rel=
"home" href=
"../../index.html" title=
"Chapter 1. Boost.Multiprecision">
8 <link rel=
"up" href=
"../perf.html" title=
"Performance Comparison">
9 <link rel=
"prev" href=
"integer_performance.html" title=
"Integer Algorithm Performance">
10 <link rel=
"next" href=
"../map.html" title=
"Roadmap">
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>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"integer_performance.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=
"../map.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>
26 <div class=
"titlepage"><div><div><h3 class=
"title">
27 <a name=
"boost_multiprecision.perf.rational_performance"></a><a class=
"link" href=
"rational_performance.html" title=
"Rational Type Performance">Rational
29 </h3></div></div></div>
31 Note that these tests are carefully designed to test performance of the underlying
32 algorithms and not memory allocation or variable copying. As usual, performance
33 results should be taken with a healthy dose of scepticism, and real-world
34 performance may vary widely depending upon the specifics of the program.
35 In each table relative times are given first, with the best performer given
36 a score of
1. Total actual times are given in brackets, measured in seconds
37 for
500000 operations.
40 <a name=
"boost_multiprecision.perf.rational_performance.operator"></a><p class=
"title"><b>Table
 1.66.
 Operator +
</b></p>
41 <div class=
"table-contents"><table class=
"table" summary=
"Operator +">
112 <span class=
"bold"><strong>1</strong></span> (
3.1237s)
117 <span class=
"bold"><strong>1</strong></span> (
6.90715s)
122 <span class=
"bold"><strong>1</strong></span> (
16.1975s)
127 <span class=
"bold"><strong>1</strong></span> (
39.1929s)
134 <br class=
"table-break"><div class=
"table">
135 <a name=
"boost_multiprecision.perf.rational_performance.operator_int"></a><p class=
"title"><b>Table
 1.67.
 Operator +(int)
</b></p>
136 <div class=
"table-contents"><table class=
"table" summary=
"Operator +(int)">
207 <span class=
"bold"><strong>1</strong></span> (
0.680215s)
212 <span class=
"bold"><strong>1</strong></span> (
0.704303s)
217 <span class=
"bold"><strong>1</strong></span> (
0.7932s)
222 <span class=
"bold"><strong>1</strong></span> (
0.907046s)
229 <br class=
"table-break"><div class=
"table">
230 <a name=
"boost_multiprecision.perf.rational_performance.operator_unsigned_long_long"></a><p class=
"title"><b>Table
 1.68.
 Operator +(unsigned long long)
</b></p>
231 <div class=
"table-contents"><table class=
"table" summary=
"Operator +(unsigned long long)">
302 <span class=
"bold"><strong>1</strong></span> (
2.28837s)
307 <span class=
"bold"><strong>1</strong></span> (
2.35189s)
312 <span class=
"bold"><strong>1</strong></span> (
2.52028s)
317 <span class=
"bold"><strong>1</strong></span> (
2.66971s)
324 <br class=
"table-break"><div class=
"table">
325 <a name=
"boost_multiprecision.perf.rational_performance.operator_unsigned_long_long0"></a><p class=
"title"><b>Table
 1.69.
 Operator +=(unsigned long long)
</b></p>
326 <div class=
"table-contents"><table class=
"table" summary=
"Operator +=(unsigned long long)">
397 <span class=
"bold"><strong>1</strong></span> (
2.2847s)
402 <span class=
"bold"><strong>1</strong></span> (
2.35183s)
407 <span class=
"bold"><strong>1</strong></span> (
2.51174s)
412 <span class=
"bold"><strong>1</strong></span> (
2.6568s)
419 <br class=
"table-break"><div class=
"table">
420 <a name=
"boost_multiprecision.perf.rational_performance.operator0"></a><p class=
"title"><b>Table
 1.70.
 Operator -
</b></p>
421 <div class=
"table-contents"><table class=
"table" summary=
"Operator -">
492 <span class=
"bold"><strong>1</strong></span> (
3.15277s)
497 <span class=
"bold"><strong>1</strong></span> (
6.91765s)
502 <span class=
"bold"><strong>1</strong></span> (
16.1859s)
507 <span class=
"bold"><strong>1</strong></span> (
39.1698s)
514 <br class=
"table-break"><div class=
"table">
515 <a name=
"boost_multiprecision.perf.rational_performance.operator_int0"></a><p class=
"title"><b>Table
 1.71.
 Operator -(int)
</b></p>
516 <div class=
"table-contents"><table class=
"table" summary=
"Operator -(int)">
587 <span class=
"bold"><strong>1</strong></span> (
0.667908s)
592 <span class=
"bold"><strong>1</strong></span> (
0.698479s)
597 <span class=
"bold"><strong>1</strong></span> (
0.805252s)
602 <span class=
"bold"><strong>1</strong></span> (
0.901066s)
609 <br class=
"table-break"><div class=
"table">
610 <a name=
"boost_multiprecision.perf.rational_performance.operator_unsigned_long_long1"></a><p class=
"title"><b>Table
 1.72.
 Operator -(unsigned long long)
</b></p>
611 <div class=
"table-contents"><table class=
"table" summary=
"Operator -(unsigned long long)">
682 <span class=
"bold"><strong>1</strong></span> (
2.27663s)
687 <span class=
"bold"><strong>1</strong></span> (
2.36262s)
692 <span class=
"bold"><strong>1</strong></span> (
2.48445s)
697 <span class=
"bold"><strong>1</strong></span> (
2.62761s)
704 <br class=
"table-break"><div class=
"table">
705 <a name=
"boost_multiprecision.perf.rational_performance.operator_unsigned_long_long2"></a><p class=
"title"><b>Table
 1.73.
 Operator -=(unsigned long long)
</b></p>
706 <div class=
"table-contents"><table class=
"table" summary=
"Operator -=(unsigned long long)">
777 <span class=
"bold"><strong>1</strong></span> (
2.28174s)
782 <span class=
"bold"><strong>1</strong></span> (
2.35348s)
787 <span class=
"bold"><strong>1</strong></span> (
2.47929s)
792 <span class=
"bold"><strong>1</strong></span> (
2.63706s)
799 <br class=
"table-break"><div class=
"table">
800 <a name=
"boost_multiprecision.perf.rational_performance.operator1"></a><p class=
"title"><b>Table
 1.74.
 Operator *
</b></p>
801 <div class=
"table-contents"><table class=
"table" summary=
"Operator *">
872 <span class=
"bold"><strong>1</strong></span> (
6.00084s)
877 <span class=
"bold"><strong>1</strong></span> (
13.0013s)
882 <span class=
"bold"><strong>1</strong></span> (
29.8475s)
887 <span class=
"bold"><strong>1</strong></span> (
71.4604s)
894 <br class=
"table-break"><div class=
"table">
895 <a name=
"boost_multiprecision.perf.rational_performance.operator_int1"></a><p class=
"title"><b>Table
 1.75.
 Operator *(int)
</b></p>
896 <div class=
"table-contents"><table class=
"table" summary=
"Operator *(int)">
967 <span class=
"bold"><strong>1</strong></span> (
1.18077s)
972 <span class=
"bold"><strong>1</strong></span> (
1.24508s)
977 <span class=
"bold"><strong>1</strong></span> (
1.3723s)
982 <span class=
"bold"><strong>1</strong></span> (
1.52902s)
989 <br class=
"table-break"><div class=
"table">
990 <a name=
"boost_multiprecision.perf.rational_performance.operator_unsigned_long_long3"></a><p class=
"title"><b>Table
 1.76.
 Operator *(unsigned long long)
</b></p>
991 <div class=
"table-contents"><table class=
"table" summary=
"Operator *(unsigned long long)">
1062 <span class=
"bold"><strong>1</strong></span> (
4.11002s)
1067 <span class=
"bold"><strong>1</strong></span> (
4.313s)
1072 <span class=
"bold"><strong>1</strong></span> (
4.71682s)
1077 <span class=
"bold"><strong>1</strong></span> (
5.31082s)
1084 <br class=
"table-break"><div class=
"table">
1085 <a name=
"boost_multiprecision.perf.rational_performance.operator_unsigned_long_long4"></a><p class=
"title"><b>Table
 1.77.
 Operator *=(unsigned long long)
</b></p>
1086 <div class=
"table-contents"><table class=
"table" summary=
"Operator *=(unsigned long long)">
1157 <span class=
"bold"><strong>1</strong></span> (
9.22804s)
1162 <span class=
"bold"><strong>1</strong></span> (
9.43733s)
1167 <span class=
"bold"><strong>1</strong></span> (
9.79739s)
1172 <span class=
"bold"><strong>1</strong></span> (
10.329s)
1179 <br class=
"table-break"><div class=
"table">
1180 <a name=
"boost_multiprecision.perf.rational_performance.operator2"></a><p class=
"title"><b>Table
 1.78.
 Operator /
</b></p>
1181 <div class=
"table-contents"><table class=
"table" summary=
"Operator /">
1252 <span class=
"bold"><strong>1</strong></span> (
15.0903s)
1257 <span class=
"bold"><strong>1</strong></span> (
27.1093s)
1262 <span class=
"bold"><strong>1</strong></span> (
55.0637s)
1267 <span class=
"bold"><strong>1</strong></span> (
124.641s)
1274 <br class=
"table-break"><div class=
"table">
1275 <a name=
"boost_multiprecision.perf.rational_performance.operator_int2"></a><p class=
"title"><b>Table
 1.79.
 Operator /(int)
</b></p>
1276 <div class=
"table-contents"><table class=
"table" summary=
"Operator /(int)">
1347 <span class=
"bold"><strong>1</strong></span> (
1.40393s)
1352 <span class=
"bold"><strong>1</strong></span> (
1.4747s)
1357 <span class=
"bold"><strong>1</strong></span> (
1.61693s)
1362 <span class=
"bold"><strong>1</strong></span> (
1.76831s)
1369 <br class=
"table-break"><div class=
"table">
1370 <a name=
"boost_multiprecision.perf.rational_performance.operator_unsigned_long_long5"></a><p class=
"title"><b>Table
 1.80.
 Operator /(unsigned long long)
</b></p>
1371 <div class=
"table-contents"><table class=
"table" summary=
"Operator /(unsigned long long)">
1442 <span class=
"bold"><strong>1</strong></span> (
4.20568s)
1447 <span class=
"bold"><strong>1</strong></span> (
4.41458s)
1452 <span class=
"bold"><strong>1</strong></span> (
4.80635s)
1457 <span class=
"bold"><strong>1</strong></span> (
5.39734s)
1464 <br class=
"table-break"><div class=
"table">
1465 <a name=
"boost_multiprecision.perf.rational_performance.operator_unsigned_long_long6"></a><p class=
"title"><b>Table
 1.81.
 Operator /=(unsigned long long)
</b></p>
1466 <div class=
"table-contents"><table class=
"table" summary=
"Operator /=(unsigned long long)">
1537 <span class=
"bold"><strong>1</strong></span> (
9.43295s)
1542 <span class=
"bold"><strong>1</strong></span> (
9.61774s)
1547 <span class=
"bold"><strong>1</strong></span> (
9.98407s)
1552 <span class=
"bold"><strong>1</strong></span> (
10.5652s)
1559 <br class=
"table-break"><div class=
"table">
1560 <a name=
"boost_multiprecision.perf.rational_performance.operator_construct"></a><p class=
"title"><b>Table
 1.82.
 Operator construct
</b></p>
1561 <div class=
"table-contents"><table class=
"table" summary=
"Operator construct">
1605 <span class=
"bold"><strong>1</strong></span> (
0.00978288s)
1610 <span class=
"bold"><strong>1</strong></span> (
0.0100574s)
1615 <span class=
"bold"><strong>1</strong></span> (
0.0101393s)
1620 <span class=
"bold"><strong>1</strong></span> (
0.0101847s)
1654 <br class=
"table-break"><div class=
"table">
1655 <a name=
"boost_multiprecision.perf.rational_performance.operator_construct_unsigned"></a><p class=
"title"><b>Table
 1.83.
 Operator construct(unsigned)
</b></p>
1656 <div class=
"table-contents"><table class=
"table" summary=
"Operator construct(unsigned)">
1700 <span class=
"bold"><strong>1</strong></span> (
0.0548151s)
1705 <span class=
"bold"><strong>1</strong></span> (
0.0557542s)
1710 <span class=
"bold"><strong>1</strong></span> (
0.055825s)
1715 <span class=
"bold"><strong>1</strong></span> (
0.0552808s)
1749 <br class=
"table-break"><div class=
"table">
1750 <a name=
"boost_multiprecision.perf.rational_performance.operator_construct_unsigned_long"></a><p class=
"title"><b>Table
 1.84.
 Operator construct(unsigned long long)
</b></p>
1751 <div class=
"table-contents"><table class=
"table" summary=
"Operator construct(unsigned long long)">
1795 <span class=
"bold"><strong>1</strong></span> (
0.0605156s)
1800 <span class=
"bold"><strong>1</strong></span> (
0.0616657s)
1805 <span class=
"bold"><strong>1</strong></span> (
0.0592056s)
1810 <span class=
"bold"><strong>1</strong></span> (
0.0603081s)
1844 <br class=
"table-break"><div class=
"table">
1845 <a name=
"boost_multiprecision.perf.rational_performance.operator_str"></a><p class=
"title"><b>Table
 1.85.
 Operator str
</b></p>
1846 <div class=
"table-contents"><table class=
"table" summary=
"Operator str">
1890 5.48898 (
0.0208949s)
1895 8.49668 (
0.0546688s)
1917 <span class=
"bold"><strong>1</strong></span> (
0.0038067s)
1922 <span class=
"bold"><strong>1</strong></span> (
0.00643413s)
1927 <span class=
"bold"><strong>1</strong></span> (
0.0120606s)
1932 <span class=
"bold"><strong>1</strong></span> (
0.0294843s)
1939 <br class=
"table-break"><p>
1940 Test code was compiled with Microsoft Visual Studio
2010 with all optimisations
1941 turned on (/Ox), and used MPIR-
2.3.0 and
<a href=
"http://www.mpfr.org" target=
"_top">MPFR
</a>-
3.0.0.
1942 The tests were run on
32-bit Windows Vista machine.
1945 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
1946 <td align=
"left"></td>
1947 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2002-
2013 John Maddock and Christopher Kormanyos
<p>
1948 Distributed under the Boost Software License, Version
1.0. (See accompanying
1949 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>)
1954 <div class=
"spirit-nav">
1955 <a accesskey=
"p" href=
"integer_performance.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=
"../map.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>