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

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

https://bitbucket.org/pizzafactory/pf-gcc
HTML | 143 lines | 142 code | 1 blank | 0 comment | 0 complexity | 627b65a1739fce8824c99f3387c6c884 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 Pop Memory Use 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>pop</tt> Memory Use 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, then pops them until only one is left in the
  16. container. It measures the memory use as a function of the
  17. number of values pushed to the container.</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_pop_mem_usage.cc"><tt>priority_queue_text_pop_mem_usage_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.</p>
  30. <div id="NPG_res_div">
  31. <div id="NPG_gcc">
  32. <div id="NPG_priority_queue_text_pop_mem_usage_test">
  33. <div id="NPG_pq">
  34. <div id="NPG_Native_and__tt_pb_ds_455tt__priority_queue__tt_pop_455tt__memory-use_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_pop_mem_usage_test_gcc.png" alt="no image" /></a></h6>NPG: Native and <tt>pb ds</tt> priority queue <tt>pop</tt> memory-use 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>
  35. <ol>
  36. <li>
  37. n_pq_vector-
  38. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  39. <li>
  40. n_pq_deque-
  41. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  42. <li>
  43. binary_heap-
  44. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  45. with <tt>Tag</tt> = <a href="binary_heap_tag.html"><tt>binary_heap_tag</tt></a>
  46. </li>
  47. <li>
  48. thin_heap-
  49. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  50. with <tt>Tag</tt> = <a href="thin_heap_tag.html"><tt>thin_heap_tag</tt></a>
  51. </li>
  52. <li>
  53. binomial_heap-
  54. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  55. with <tt>Tag</tt> = <a href="binomial_heap_tag.html"><tt>binomial_heap_tag</tt></a>
  56. </li>
  57. <li>
  58. rc_binomial_heap-
  59. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  60. with <tt>Tag</tt> = <a href="rc_binomial_heap_tag.html"><tt>rc_binomial_heap_tag</tt></a>
  61. </li>
  62. <li>
  63. pairing_heap-
  64. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  65. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  66. </li>
  67. </ol>
  68. </div><div style="width: 100%; height: 20px"></div></div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <div id="NPM_res_div">
  74. <div id="NPM_msvc">
  75. <div id="NPM_priority_queue_text_pop_mem_usage_test">
  76. <div id="NPM_pq">
  77. <div id="NPM_Native_and__tt_pb_ds_455tt__priority_queue__tt_pop_455tt__memory-use_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_pop_mem_usage_test_msvc.png" alt="no image" /></a></h6>NPM: Native and <tt>pb ds</tt> priority queue <tt>pop</tt> memory-use 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>
  78. <ol>
  79. <li>
  80. n_pq_vector-
  81. <tt>std::priority_queue</tt> adapting <tt>std::vector</tt></li>
  82. <li>
  83. n_pq_deque-
  84. <tt>std::priority_queue</tt> adapting <tt>std::deque</tt></li>
  85. <li>
  86. binary_heap-
  87. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  88. with <tt>Tag</tt> = <a href="binary_heap_tag.html"><tt>binary_heap_tag</tt></a>
  89. </li>
  90. <li>
  91. thin_heap-
  92. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  93. with <tt>Tag</tt> = <a href="thin_heap_tag.html"><tt>thin_heap_tag</tt></a>
  94. </li>
  95. <li>
  96. binomial_heap-
  97. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  98. with <tt>Tag</tt> = <a href="binomial_heap_tag.html"><tt>binomial_heap_tag</tt></a>
  99. </li>
  100. <li>
  101. rc_binomial_heap-
  102. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  103. with <tt>Tag</tt> = <a href="rc_binomial_heap_tag.html"><tt>rc_binomial_heap_tag</tt></a>
  104. </li>
  105. <li>
  106. pairing_heap-
  107. <a href="priority_queue.html"><tt>priority_queue</tt></a>
  108. with <tt>Tag</tt> = <a href="pairing_heap_tag.html"><tt>pairing_heap_tag</tt></a>
  109. </li>
  110. </ol>
  111. </div><div style="width: 100%; height: 20px"></div></div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div id="NPL_res_div">
  117. <div id="NPL_local">
  118. <div id="NPL_priority_queue_text_pop_mem_usage_test">
  119. <div id="NPL_pq">
  120. <div id="NPL_Native_and__tt_pb_ds_455tt__priority_queue__tt_pop_455tt__memory-use_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_pop_mem_usage_test_local.png" alt="no image" /></a></h6>NPL: Native and <tt>pb ds</tt> priority queue <tt>pop</tt> memory-use test - <a href = "pq_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <h2><a name="observations" id="observations">Observations</a></h2>
  126. <p>The priority queue implementations (excluding the STL's) use
  127. memory proportionally to the number of values they hold:
  128. node-based implementations (<i>e.g.</i>, a pairing heap) do so
  129. naturally; <tt>pb_ds</tt>'s binary heap de-allocates memory when
  130. a certain lower threshold is exceeded.</p>
  131. <p>Note from <a href="priority_queue_text_push_pop_timing_test.html">Priority Queue
  132. Text <tt>push</tt> and <tt>pop</tt> Timing Test</a> and
  133. <a href="priority_queue_random_int_push_pop_timing_test.html">Priority
  134. Queue Random Integer <tt>push</tt> and <tt>pop</tt> Timing
  135. Test</a> that this does not impede performance compared to the
  136. STL's priority queues.</p>
  137. <p>(See <a href="hash_random_int_erase_mem_usage_test.html">Hash-Based Erase
  138. Memory Use Test</a> for a similar phenomenon regarding priority
  139. queues.)</p>
  140. </div>
  141. </body>
  142. </html>