PageRenderTime 39ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/pizzafactory/pf-gcc
HTML | 209 lines | 208 code | 1 blank | 0 comment | 0 complexity | 8f97a1aceb509c839990083401241352 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 Pop 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> and <tt>pop</tt> Timing
  12. Test</h1>
  13. <h2><a name="description" id="description">Description</a></h2>
  14. <p>This test inserts a number of values with keys from an
  15. arbitrary text ([ <a href="references.html#wickland96thirty">wickland96thirty</a> ]) into
  16. a container using <tt>push</tt> , then removes them using
  17. <tt>pop</tt> . It measures the average time for <tt>push</tt>
  18. as a function of the number of values.</p>
  19. <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_pop_timing.cc"><tt>
  20. priority_queue_text_push_pop_timing_test</tt></a>
  21. thirty_years_among_the_dead_preproc.txt 200 200 2100)</p>
  22. <h2><a name="purpose" id="purpose">Purpose</a></h2>
  23. <p>The test checks the effect of different underlying
  24. data structures (see <a href="pq_design.html#pq_imp">Design::Priority
  25. Queues::Implementations</a>).</p>
  26. <h2><a name="results" id="results">Results</a></h2>
  27. <p>Figures <a href="#NPG">NPG</a>, <a href="#NPM">NPM</a>, and
  28. <a href="#NPL">NPL</a> show the results for the native priority
  29. 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
  30. <a href="pq_performance_tests.html#local"><u>local</u></a>,
  31. respectively; Figures <a href="#NBRG">NBRG</a>, <a href="#NBRM">NBRM</a>, and <a href="#NBRL">NBRL</a> show the results
  32. for the native priority queues and <tt>pb_ds</tt>'s pairing
  33. 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
  34. <a href="pq_performance_tests.html#local"><u>local</u></a>,
  35. respectively.</p>
  36. <div id="NPG_res_div">
  37. <div id="NPG_gcc">
  38. <div id="NPG_priority_queue_text_push_pop_timing_test">
  39. <div id="NPG_pq">
  40. <div id="NPG_Native_tree_and__tt_pb_ds_455tt__priority_queue__tt_push_455tt__and__tt_pop_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_pop_timing_test_gcc.png" alt="no image" /></a></h6>NPG: Native tree and <tt>pb ds</tt> priority queue <tt>push</tt> and <tt>pop</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>
  41. <ol>
  42. <li>
  43. n_pq_vector-
  44. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  45. <li>
  46. n_pq_deque-
  47. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  48. <li>
  49. thin_heap-
  50. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  51. with <tt>Tag</tt> = <a href="thin_heap_tag.html"><tt>thin_heap_tag</tt></a>
  52. </li>
  53. <li>
  54. rc_binomial_heap-
  55. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  56. with <tt>Tag</tt> = <a href="rc_binomial_heap_tag.html"><tt>rc_binomial_heap_tag</tt></a>
  57. </li>
  58. <li>
  59. binomial_heap-
  60. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  61. with <tt>Tag</tt> = <a href="binomial_heap_tag.html"><tt>binomial_heap_tag</tt></a>
  62. </li>
  63. <li>
  64. binary_heap-
  65. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  66. with <tt>Tag</tt> = <a href="binary_heap_tag.html"><tt>binary_heap_tag</tt></a>
  67. </li>
  68. <li>
  69. pairing_heap-
  70. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  71. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  72. </li>
  73. </ol>
  74. </div><div style="width: 100%; height: 20px"></div></div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <div id="NPM_res_div">
  80. <div id="NPM_msvc">
  81. <div id="NPM_priority_queue_text_push_pop_timing_test">
  82. <div id="NPM_pq">
  83. <div id="NPM_Native_tree_and__tt_pb_ds_455tt__priority_queue__tt_push_455tt__and__tt_pop_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_pop_timing_test_msvc.png" alt="no image" /></a></h6>NPM: Native tree and <tt>pb ds</tt> priority queue <tt>push</tt> and <tt>pop</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>
  84. <ol>
  85. <li>
  86. n_pq_deque-
  87. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  88. <li>
  89. n_pq_vector-
  90. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  91. <li>
  92. thin_heap-
  93. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  94. with <tt>Tag</tt> = <a href="thin_heap_tag.html"><tt>thin_heap_tag</tt></a>
  95. </li>
  96. <li>
  97. rc_binomial_heap-
  98. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  99. with <tt>Tag</tt> = <a href="rc_binomial_heap_tag.html"><tt>rc_binomial_heap_tag</tt></a>
  100. </li>
  101. <li>
  102. binomial_heap-
  103. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  104. with <tt>Tag</tt> = <a href="binomial_heap_tag.html"><tt>binomial_heap_tag</tt></a>
  105. </li>
  106. <li>
  107. pairing_heap-
  108. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  109. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  110. </li>
  111. <li>
  112. binary_heap-
  113. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  114. with <tt>Tag</tt> = <a href="binary_heap_tag.html"><tt>binary_heap_tag</tt></a>
  115. </li>
  116. </ol>
  117. </div><div style="width: 100%; height: 20px"></div></div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <div id="NPL_res_div">
  123. <div id="NPL_local">
  124. <div id="NPL_priority_queue_text_push_pop_timing_test">
  125. <div id="NPL_pq">
  126. <div id="NPL_Native_tree_and__tt_pb_ds_455tt__priority_queue__tt_push_455tt__and__tt_pop_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_pop_timing_test_local.png" alt="no image" /></a></h6>NPL: Native tree and <tt>pb ds</tt> priority queue <tt>push</tt> and <tt>pop</tt> timing test - <a href = "pq_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. <div id="NBRG_res_div">
  132. <div id="NBRG_gcc">
  133. <div id="NBRG_pairing_priority_queue_text_push_pop_timing_test">
  134. <div id="NBRG_pq">
  135. <div id="NBRG_Native_tree_and__tt_pb_ds_455tt__pairing_priority_queue__tt_push_455tt__and__tt_pop_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_pop_timing_test_gcc.png" alt="no image" /></a></h6>NBRG: Native tree and <tt>pb ds</tt> pairing priority queue <tt>push</tt> and <tt>pop</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>
  136. <ol>
  137. <li>
  138. n_pq_vector-
  139. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  140. <li>
  141. n_pq_deque-
  142. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  143. <li>
  144. pairing_heap-
  145. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  146. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  147. </li>
  148. </ol>
  149. </div><div style="width: 100%; height: 20px"></div></div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. <div id="NBRM_res_div">
  155. <div id="NBRM_msvc">
  156. <div id="NBRM_pairing_priority_queue_text_push_pop_timing_test">
  157. <div id="NBRM_pq">
  158. <div id="NBRM_Native_tree_and__tt_pb_ds_455tt__pairing_priority_queue__tt_push_455tt__and__tt_pop_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_pop_timing_test_msvc.png" alt="no image" /></a></h6>NBRM: Native tree and <tt>pb ds</tt> pairing priority queue <tt>push</tt> and <tt>pop</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>
  159. <ol>
  160. <li>
  161. n_pq_deque-
  162. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  163. <li>
  164. n_pq_vector-
  165. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  166. <li>
  167. pairing_heap-
  168. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  169. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  170. </li>
  171. </ol>
  172. </div><div style="width: 100%; height: 20px"></div></div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. <div id="NBRL_res_div">
  178. <div id="NBRL_local">
  179. <div id="NBRL_pairing_priority_queue_text_push_pop_timing_test">
  180. <div id="NBRL_pq">
  181. <div id="NBRL_Native_tree_and__tt_pb_ds_455tt__pairing_priority_queue__tt_push_455tt__and__tt_pop_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_pop_timing_test_local.png" alt="no image" /></a></h6>NBRL: Native tree and <tt>pb ds</tt> pairing priority queue <tt>push</tt> and <tt>pop</tt> timing test - <a href = "pq_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. <h2><a name="observations" id="observations">Observations</a></h2>
  187. <p>These results are very similar to <a href="priority_queue_text_push_timing_test.html">Priority Queue Text
  188. <tt>push</tt> Timing Test</a>. As stated there, pairing heaps
  189. (<a href="priority_queue.html"><tt>priority_queue</tt></a> with
  190. <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>)
  191. are most suited for <tt>push</tt> and <tt>pop</tt> sequences of
  192. non-primitive types such as strings. Observing these two tests,
  193. one can note that a pairing heap outperforms the others in
  194. terms of <tt>push</tt> operations, but equals binary heaps
  195. (<a href="priority_queue.html"><tt>priority_queue</tt></a> with
  196. <tt>Tag</tt> = <a href="binary_heap_tag.html"><tt>binary_heap_tag</tt></a>) if
  197. the number of <tt>push</tt> and <tt>pop</tt> operations is
  198. equal. As the number of <tt>pop</tt> operations is at most
  199. equal to the number of <tt>push</tt> operations, pairing heaps
  200. are better in this case. See <a href="priority_queue_random_int_push_pop_timing_test.html">Priority
  201. Queue Random Integer <tt>push</tt> and <tt>pop</tt> Timing
  202. Test</a> for a case which is different.</p>
  203. <p><a href="pq_performance_tests.html#pq_observations">Priority-Queue
  204. Performance Tests::Observations</a> discusses this further and
  205. summarizes.</p>
  206. </div>
  207. </body>
  208. </html>