PageRenderTime 37ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/libstdc++-v3/doc/html/ext/pb_ds/priority_queue_text_push_timing_test.html

https://bitbucket.org/pizzafactory/pf-gcc
HTML | 219 lines | 218 code | 1 blank | 0 comment | 0 complexity | 78cf36da711c7b66d0b950175ea2803f MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta name="generator" content="HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" />
  6. <title>Priority Queue Text Push Timing Test</title>
  7. <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
  8. </head>
  9. <body>
  10. <div id="page">
  11. <h1>Priority Queue Text <tt>push</tt> Timing Test</h1>
  12. <h2><a name="description" id="description">Description</a></h2>
  13. <p>This test inserts a number of values with keys from an
  14. arbitrary text ([ <a href="references.html#wickland96thirty">wickland96thirty</a> ]) into
  15. a container using <tt>push</tt> . It measures the average time
  16. for <tt>push</tt> as a function of the number of values
  17. pushed.</p>
  18. <p>(The test was executed with <a href="http://gcc.gnu.org/viewcvs/*checkout*/trunk/libstdc%2B%2B-v3/testsuite/performance/ext/pb_ds/priority_queue_text_push_timing.cc"><tt>priority_queue_text_push_timing_test</tt></a>
  19. thirty_years_among_the_dead_preproc.txt 200 200 2100)</p>
  20. <h2><a name="purpose" id="purpose">Purpose</a></h2>
  21. <p>The test checks the effect of different underlying
  22. data structures (see <a href="pq_design.html#pq_imp">Design::Priority
  23. Queues::Implementations</a>).</p>
  24. <h2><a name="results" id="results">Results</a></h2>
  25. <p>Figures <a href="#NPG">NPG</a>, <a href="#NPM">NPM</a>, and
  26. <a href="#NPL">NPL</a> show the results for the native priority
  27. queues and <tt>pb_ds</tt> 's priority queues in <a href="pq_performance_tests.html#gcc"><u>g++</u></a>, <a href="pq_performance_tests.html#msvc"><u>msvc++</u></a>, and
  28. <a href="pq_performance_tests.html#local"><u>local</u></a>,
  29. respectively; Figures <a href="#NBRG">NBRG</a>, <a href="#NBRM">NBRM</a>, and <a href="#NBRL">NBRL</a> shows the
  30. results for the binary-heap based native priority queues and
  31. <tt>pb_ds</tt>'s pairing-heap priority queues in <a href="pq_performance_tests.html#gcc"><u>g++</u></a>, <a href="pq_performance_tests.html#msvc"><u>msvc++</u></a>, and
  32. <a href="pq_performance_tests.html#local"><u>local</u></a>,
  33. respectively</p>
  34. <div id="NPG_res_div">
  35. <div id="NPG_gcc">
  36. <div id="NPG_priority_queue_text_push_timing_test">
  37. <div id="NPG_pq">
  38. <div id="NPG_Native_and__tt_pb_ds_455tt__priority_queue__tt_push_455tt__timing_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NPG" id="NPG"><img src="priority_queue_text_push_timing_test_gcc.png" alt="no image" /></a></h6>NPG: Native and <tt>pb ds</tt> priority queue <tt>push</tt> timing test - <a href="pq_performance_tests.html#gcc">g++</a><p>In the above figure, the names in the legends have the following meaning:</p>
  39. <ol>
  40. <li>
  41. n_pq_vector-
  42. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  43. <li>
  44. n_pq_deque-
  45. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  46. <li>
  47. binary_heap-
  48. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  49. with <tt>Tag</tt> = <a href="binary_heap_tag.html"><tt>binary_heap_tag</tt></a>
  50. </li>
  51. <li>
  52. rc_binomial_heap-
  53. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  54. with <tt>Tag</tt> = <a href="rc_binomial_heap_tag.html"><tt>rc_binomial_heap_tag</tt></a>
  55. </li>
  56. <li>
  57. thin_heap-
  58. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  59. with <tt>Tag</tt> = <a href="thin_heap_tag.html"><tt>thin_heap_tag</tt></a>
  60. </li>
  61. <li>
  62. binomial_heap-
  63. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  64. with <tt>Tag</tt> = <a href="binomial_heap_tag.html"><tt>binomial_heap_tag</tt></a>
  65. </li>
  66. <li>
  67. pairing_heap-
  68. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  69. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  70. </li>
  71. </ol>
  72. </div><div style="width: 100%; height: 20px"></div></div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <div id="NPM_res_div">
  78. <div id="NPM_msvc">
  79. <div id="NPM_priority_queue_text_push_timing_test">
  80. <div id="NPM_pq">
  81. <div id="NPM_Native_and__tt_pb_ds_455tt__priority_queue__tt_push_455tt__timing_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NPM" id="NPM"><img src="priority_queue_text_push_timing_test_msvc.png" alt="no image" /></a></h6>NPM: Native and <tt>pb ds</tt> priority queue <tt>push</tt> timing test - <a href="pq_performance_tests.html#msvc">msvc++</a><p>In the above figure, the names in the legends have the following meaning:</p>
  82. <ol>
  83. <li>
  84. n_pq_deque-
  85. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  86. <li>
  87. rc_binomial_heap-
  88. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  89. with <tt>Tag</tt> = <a href="rc_binomial_heap_tag.html"><tt>rc_binomial_heap_tag</tt></a>
  90. </li>
  91. <li>
  92. binary_heap-
  93. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  94. with <tt>Tag</tt> = <a href="binary_heap_tag.html"><tt>binary_heap_tag</tt></a>
  95. </li>
  96. <li>
  97. binomial_heap-
  98. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  99. with <tt>Tag</tt> = <a href="binomial_heap_tag.html"><tt>binomial_heap_tag</tt></a>
  100. </li>
  101. <li>
  102. n_pq_vector-
  103. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  104. <li>
  105. pairing_heap-
  106. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  107. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  108. </li>
  109. <li>
  110. thin_heap-
  111. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  112. with <tt>Tag</tt> = <a href="thin_heap_tag.html"><tt>thin_heap_tag</tt></a>
  113. </li>
  114. </ol>
  115. </div><div style="width: 100%; height: 20px"></div></div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <div id="NPL_res_div">
  121. <div id="NPL_local">
  122. <div id="NPL_priority_queue_text_push_timing_test">
  123. <div id="NPL_pq">
  124. <div id="NPL_Native_and__tt_pb_ds_455tt__priority_queue__tt_push_455tt__timing_test"><div style = "border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NPL" id= "NPL"><img src="priority_queue_text_push_timing_test_local.png" alt="no image" /></a></h6>NPL: Native and <tt>pb ds</tt> priority queue <tt>push</tt> timing test - <a href = "pq_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <div id="NBRG_res_div">
  130. <div id="NBRG_gcc">
  131. <div id="NBRG_pairing_priority_queue_text_push_timing_test">
  132. <div id="NBRG_pq">
  133. <div id="NBRG_Native_and__tt_pb_ds_455tt__pairing_priority_queue__tt_push_455tt__timing_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NBRG" id="NBRG"><img src="pairing_priority_queue_text_push_timing_test_gcc.png" alt="no image" /></a></h6>NBRG: Native and <tt>pb ds</tt> pairing priority queue <tt>push</tt> timing test - <a href="pq_performance_tests.html#gcc">g++</a><p>In the above figure, the names in the legends have the following meaning:</p>
  134. <ol>
  135. <li>
  136. n_pq_vector-
  137. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  138. <li>
  139. n_pq_deque-
  140. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  141. <li>
  142. thin_heap-
  143. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  144. with <tt>Tag</tt> = <a href="thin_heap_tag.html"><tt>thin_heap_tag</tt></a>
  145. </li>
  146. <li>
  147. pairing_heap-
  148. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  149. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  150. </li>
  151. </ol>
  152. </div><div style="width: 100%; height: 20px"></div></div>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. <div id="NBRM_res_div">
  158. <div id="NBRM_msvc">
  159. <div id="NBRM_pairing_priority_queue_text_push_timing_test">
  160. <div id="NBRM_pq">
  161. <div id="NBRM_Native_and__tt_pb_ds_455tt__pairing_priority_queue__tt_push_455tt__timing_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NBRM" id="NBRM"><img src="pairing_priority_queue_text_push_timing_test_msvc.png" alt="no image" /></a></h6>NBRM: Native and <tt>pb ds</tt> pairing priority queue <tt>push</tt> timing test - <a href="pq_performance_tests.html#msvc">msvc++</a><p>In the above figure, the names in the legends have the following meaning:</p>
  162. <ol>
  163. <li>
  164. n_pq_deque-
  165. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  166. <li>
  167. n_pq_vector-
  168. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  169. <li>
  170. pairing_heap-
  171. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  172. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  173. </li>
  174. <li>
  175. thin_heap-
  176. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  177. with <tt>Tag</tt> = <a href="thin_heap_tag.html"><tt>thin_heap_tag</tt></a>
  178. </li>
  179. </ol>
  180. </div><div style="width: 100%; height: 20px"></div></div>
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. <div id="NBRL_res_div">
  186. <div id="NBRL_local">
  187. <div id="NBRL_pairing_priority_queue_text_push_timing_test">
  188. <div id="NBRL_pq">
  189. <div id="NBRL_Native_and__tt_pb_ds_455tt__pairing_priority_queue__tt_push_455tt__timing_test"><div style = "border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NBRL" id= "NBRL"><img src="pairing_priority_queue_text_push_timing_test_local.png" alt="no image" /></a></h6>NBRL: Native and <tt>pb ds</tt> pairing priority queue <tt>push</tt> timing test - <a href = "pq_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <h2><a name="observations" id="observations">Observations</a></h2>
  195. <p>Pairing heaps (<a href="priority_queue.html"><tt>priority_queue</tt></a> with
  196. <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>)
  197. are the most suited for sequences of <tt>push</tt> and
  198. <tt>pop</tt> operations of non-primitive types (<i>e.g.</i>
  199. <tt>std::string</tt>s). (see also <a href="priority_queue_text_push_pop_timing_test.html">Priority Queue
  200. Text <tt>push</tt> and <tt>pop</tt> Timing Test</a>.) They are
  201. less constrained than binomial heaps, <i>e.g.</i>, and since
  202. they are node-based, they outperform binary heaps. (See
  203. <a href="priority_queue_random_int_push_timing_test.html">Priority
  204. Queue Random Integer <tt>push</tt> Timing Test</a> for the case
  205. of primitive types.)</p>
  206. <p>The STL's priority queues do not seem to perform well in
  207. this case: the <tt>std::vector</tt> implementation needs to
  208. perform a logarithmic sequence of string operations for each
  209. operation, and the deque implementation is possibly hampered by
  210. its need to manipulate a relatively-complex type (deques
  211. support a <i>O(1)</i> <tt>push_front</tt>, even though it is
  212. not used by <tt>std::priority_queue</tt>.)</p>
  213. <p><a href="pq_performance_tests.html#pq_observations">Priority-Queue
  214. Performance Tests::Observations</a> discusses this further and
  215. summarizes.</p>
  216. </div>
  217. </body>
  218. </html>