PageRenderTime 34ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/pizzafactory/pf-gcc
HTML | 141 lines | 140 code | 1 blank | 0 comment | 0 complexity | 74703a9a9577700f40a12091b539047e 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 Join 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>join</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. two containers, then merges the containers. It uses
  16. <tt>join</tt> for <tt>pb_ds</tt>'s priority queues; for the
  17. STL's priority queues, it successively pops values from one
  18. container and pushes them into the other. The test measures the
  19. average time as a function of the number of values.</p>
  20. <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_join_timing.cc"><tt>priority_queue_text_join_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 <a href="pq_performance_tests.html#local"><u>local</u></a>,
  30. respectively.</p>
  31. <div id="NPG_res_div">
  32. <div id="NPG_gcc">
  33. <div id="NPG_priority_queue_text_join_timing_test">
  34. <div id="NPG_pq">
  35. <div id="NPG_Native_tree_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_join_timing_test_gcc.png" alt="no image" /></a></h6>NPG: Native tree 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>
  36. <ol>
  37. <li>
  38. n_pq_deque-
  39. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  40. <li>
  41. n_pq_vector-
  42. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  43. <li>
  44. binary_heap-
  45. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  46. with <tt>Tag</tt> = <a href="binary_heap_tag.html"><tt>binary_heap_tag</tt></a>
  47. </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. pairing_heap-
  60. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  61. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  62. </li>
  63. <li>
  64. binomial_heap-
  65. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  66. with <tt>Tag</tt> = <a href="binomial_heap_tag.html"><tt>binomial_heap_tag</tt></a>
  67. </li>
  68. </ol>
  69. </div><div style="width: 100%; height: 20px"></div></div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <div id="NPM_res_div">
  75. <div id="NPM_msvc">
  76. <div id="NPM_priority_queue_text_join_timing_test">
  77. <div id="NPM_pq">
  78. <div id="NPM_Native_tree_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_join_timing_test_msvc.png" alt="no image" /></a></h6>NPM: Native tree 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>
  79. <ol>
  80. <li>
  81. n_pq_deque-
  82. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  83. <li>
  84. n_pq_vector-
  85. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  86. <li>
  87. binary_heap-
  88. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  89. with <tt>Tag</tt> = <a href="binary_heap_tag.html"><tt>binary_heap_tag</tt></a>
  90. </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. pairing_heap-
  103. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  104. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  105. </li>
  106. <li>
  107. binomial_heap-
  108. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  109. with <tt>Tag</tt> = <a href="binomial_heap_tag.html"><tt>binomial_heap_tag</tt></a>
  110. </li>
  111. </ol>
  112. </div><div style="width: 100%; height: 20px"></div></div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <div id="NPL_res_div">
  118. <div id="NPL_local">
  119. <div id="NPL_priority_queue_text_join_timing_test">
  120. <div id="NPL_pq">
  121. <div id="NPL_Native_tree_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_join_timing_test_local.png" alt="no image" /></a></h6>NPL: Native tree 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>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <h2><a name="observations" id="observations">Observations</a></h2>
  127. <p>In this test the node-based heaps perform <tt>join</tt> in
  128. either logarithmic or constant time. The binary heap requires
  129. linear time, since the well-known heapify algorithm [<a href="references.html#clrs2001">clrs2001</a>] is linear.</p>
  130. <p>It would be possible to apply the heapify algorithm to the
  131. STL containers, if they would support iteration (which they
  132. don't). Barring iterators, it is still somehow possible to
  133. perform linear-time merge on a <tt>std::vector</tt>-based STL
  134. priority queue, using <tt>top()</tt> and <tt>size()</tt> (since
  135. they are enough to expose the underlying array), but this is
  136. impossible for a <tt>std::deque</tt>-based STL priority queue.
  137. Without heapify, the cost is super-linear.</p>
  138. </div>
  139. </body>
  140. </html>