PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/pizzafactory/pf-gcc
HTML | 173 lines | 172 code | 1 blank | 0 comment | 0 complexity | bcbb66308e0ee23a005d9f4dfd6624c4 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>Tree Text Locality of Reference 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>Hash-Based Erase Memory-Use Test</h1>
  12. <h2><a name="description" id="description">Description</a></h2>
  13. <p>This test inserts a number of uniform i.i.d. integer keys
  14. into a container, then erases all keys except one. It measures
  15. the final size of the container.</p>
  16. <p>(The test was executed with <a href="http://gcc.gnu.org/viewcvs/*checkout*/trunk/libstdc%2B%2B-v3/testsuite/performance/ext/pb_ds/hash_random_int_erase_mem_usage.cc"><tt>hash_random_int_erase_mem_usage.cc</tt></a>
  17. 2000 2000 2100)</p>
  18. <h2><a name="purpose" id="purpose">Purpose</a></h2>
  19. <p>The test checks how containers adjust internally as their
  20. logical size decreases (see <a href="motivation.html#assoc_ers_methods">Motivation::Associative
  21. Containers::Slightly Different Methods::Methods Related to
  22. Erase</a>).</p>
  23. <h2><a name="results" id="results">Results</a></h2>
  24. <p>Figures <a href="#NHG">NHG</a>, <a href="#NHM">NHM</a> and
  25. <a href="#NHL">NHL</a> show the results for the native and
  26. collision-chaining types in <a href="assoc_performance_tests.html#gcc"><u>g++</u></a>, <a href="assoc_performance_tests.html#msvc"><u>msvc++</u></a> and
  27. <a href="assoc_performance_tests.html#local"><u>local</u></a>,
  28. respectively.</p>
  29. <div id="NHG_res_div">
  30. <div id="NHG_gcc">
  31. <div id="NHG_hash_random_int_erase_mem_usage_test">
  32. <div id="NHG_assoc">
  33. <div id="NHG_Native_456_collision-chaing_456_and_probing_456_hash_random_int_erase_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NHG" id="NHG"><img src="hash_random_int_erase_mem_usage_test_gcc.png" alt="no image" /></a></h6>NHG: Native, collision-chaing, and probing, hash random int erase test - <a href="assoc_performance_tests.html#gcc">g++</a><p>In the above figure, the names in the legends have the following meaning:</p>
  34. <ol>
  35. <li>
  36. n_hash_set_ncah-
  37. <tt>std::tr1::unordered_set</tt> with <tt>cache_hash_code</tt> = <tt><b>false</b></tt></li>
  38. <li>
  39. gp_hash_mask_linp_exp_nea_lc_1div8_1div2_nsth_set-
  40. <a href="gp_hash_table.html"><tt>gp_hash_table</tt></a>
  41. with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
  42. , <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
  43. with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
  44. , and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
  45. with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i>, and <tt>Probe_Fn</tt> = <a href="linear_probe_fn.html"><tt>linear_probe_fn</tt></a>
  46. </li>
  47. <li>
  48. cc_hash_mod_prime_nea_lc_1div8_1div1_nsth_set-
  49. <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
  50. with <tt>Comb_Hash_Fn</tt> = <a href="direct_mod_range_hashing.html"><tt>direct_mod_range_hashing</tt></a>
  51. , and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
  52. with <tt>Size_Policy</tt> = <a href="hash_prime_size_policy.html"><tt>hash_prime_size_policy</tt></a>
  53. , and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
  54. with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/1</i></li>
  55. <li>
  56. cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set-
  57. <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
  58. with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
  59. , and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
  60. with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
  61. , and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
  62. with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i></li>
  63. </ol>
  64. </div><div style="width: 100%; height: 20px"></div></div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div id="NHM_res_div">
  70. <div id="NHM_msvc">
  71. <div id="NHM_hash_random_int_erase_mem_usage_test">
  72. <div id="NHM_assoc">
  73. <div id="NHM_Native_456_collision-chaing_456_and_probing_456_hash_random_int_erase_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NHM" id="NHM"><img src="hash_random_int_erase_mem_usage_test_msvc.png" alt="no image" /></a></h6>NHM: Native, collision-chaing, and probing, hash random int erase test - <a href="assoc_performance_tests.html#msvc">msvc++</a><p>In the above figure, the names in the legends have the following meaning:</p>
  74. <ol>
  75. <li>
  76. n_hash_set_ncah-
  77. <tt>stdext::hash_set</tt></li>
  78. <li>
  79. gp_hash_mask_linp_exp_nea_lc_1div8_1div2_nsth_set-
  80. <a href="gp_hash_table.html"><tt>gp_hash_table</tt></a>
  81. with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
  82. , <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
  83. with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
  84. , and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
  85. with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i>, and <tt>Probe_Fn</tt> = <a href="linear_probe_fn.html"><tt>linear_probe_fn</tt></a>
  86. </li>
  87. <li>
  88. cc_hash_mod_prime_nea_lc_1div8_1div1_nsth_set-
  89. <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
  90. with <tt>Comb_Hash_Fn</tt> = <a href="direct_mod_range_hashing.html"><tt>direct_mod_range_hashing</tt></a>
  91. , and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
  92. with <tt>Size_Policy</tt> = <a href="hash_prime_size_policy.html"><tt>hash_prime_size_policy</tt></a>
  93. , and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
  94. with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/1</i></li>
  95. <li>
  96. cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set-
  97. <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
  98. with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
  99. , and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
  100. with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
  101. , and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
  102. with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i></li>
  103. </ol>
  104. </div><div style="width: 100%; height: 20px"></div></div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <div id="NHM_res_div">
  110. <div id="NHM_msvc">
  111. <div id="NHM_hash_random_int_erase_mem_usage_test">
  112. <div id="NHM_assoc">
  113. <div id="NHM_Native_456_collision-chaing_456_and_probing_456_hash_random_int_erase_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NHM" id="NHM"><img src="hash_random_int_erase_mem_usage_test_msvc.png" alt="no image" /></a></h6>NHM: Native, collision-chaing, and probing, hash random int erase test - <a href="assoc_performance_tests.html#msvc">msvc++</a><p>In the above figure, the names in the legends have the following meaning:</p>
  114. <ol>
  115. <li>
  116. n_hash_set_ncah-
  117. <tt>stdext::hash_set</tt></li>
  118. <li>
  119. gp_hash_mask_linp_exp_nea_lc_1div8_1div2_nsth_set-
  120. <a href="gp_hash_table.html"><tt>gp_hash_table</tt></a>
  121. with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
  122. , <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
  123. with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
  124. , and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
  125. with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i>, and <tt>Probe_Fn</tt> = <a href="linear_probe_fn.html"><tt>linear_probe_fn</tt></a>
  126. </li>
  127. <li>
  128. cc_hash_mod_prime_nea_lc_1div8_1div1_nsth_set-
  129. <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
  130. with <tt>Comb_Hash_Fn</tt> = <a href="direct_mod_range_hashing.html"><tt>direct_mod_range_hashing</tt></a>
  131. , and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
  132. with <tt>Size_Policy</tt> = <a href="hash_prime_size_policy.html"><tt>hash_prime_size_policy</tt></a>
  133. , and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
  134. with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/1</i></li>
  135. <li>
  136. cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set-
  137. <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
  138. with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
  139. , and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
  140. with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
  141. , and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
  142. with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i></li>
  143. </ol>
  144. </div><div style="width: 100%; height: 20px"></div></div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <div id="NHL_res_div">
  150. <div id="NHL_local">
  151. <div id="NHL_hash_random_int_erase_mem_usage_test">
  152. <div id="NHL_assoc">
  153. <div id="NHL_Native_456_collision-chaing_456_and_probing_456_hash_random_int_erase_test"><div style = "border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NHL" id= "NHL"><img src="hash_random_int_erase_mem_usage_test_local.png" alt="no image" /></a></h6>NHL: Native, collision-chaing, and probing, hash random int erase test - <a href = "assoc_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <h2><a name="observations" id="observations">Observations</a></h2>
  159. <p>STL hash-based containers act very differently than trees in
  160. this respect. When erasing numerous keys from an STL
  161. associative-container, the resulting memory user varies greatly
  162. depending on whether the container is tree-based or hash-based.
  163. As noted in <a href="motivation.html#assoc_methods">Motivation::Choice of
  164. Methods</a> , this is a fundamental consequence of the STL's
  165. associative containers' interface, it is not due to a specific
  166. implementation.</p>
  167. <p>(See <a href="priority_queue_text_pop_mem_usage_test.html">Priority Queue
  168. Text <tt>pop</tt> Memory Use Test</a> for a similar phenomenon
  169. regarding priority queues.)</p>
  170. </div>
  171. </body>
  172. </html>