1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 5<head> 6<meta name="generator" content="HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" /> 7<title>Hash-List "Multimap" Text Memory Use Test with Large 8 Average Secondary-Key to Primary-Key Ratio</title> 9<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> 10</head> 11<body> 12<div id="page"> 13<h1>"Multimap" Text Memory Use Test with Large Average 14 Secondary-Key to Primary-Key Ratio</h1> 15<h2><a name="description" id="description">Description</a></h2> 16<p>This test inserts a number of pairs into a container. The 17 first item of each pair is a string from an arbitrary text 18 [<a href="references.html#wickland96thirty">wickland96thirty</a>], and 19 the second is a uniform i.i.d.integer. The container is a 20 "multimap" - it considers the first member of each pair as a 21 primary key, and the second member of each pair as a secondary 22 key (see <a href="motivation.html#assoc_mapping_semantics">Motivation::Associative 23 Containers::Alternative to Multiple Equivalent Keys</a>). There 24 are 100 distinct primary keys. The test measures the memory use 25 as a function of the number of values inserted.</p> 26<p>(The test was executed with <a href="http://gcc.gnu.org/viewcvs/*checkout*/trunk/libstdc%2B%2B-v3/testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage_large.cc"><tt>multimap_text_insert_mem_usage_test</tt></a> 27 thirty_years_among_the_dead_preproc.txt 100 200 2100 100)</p> 28<h2><a name="purpose" id="purpose">Purpose</a></h2> 29<p>The test checks the memory scalability of different 30 "multimap" designs (see <a href="motivation.html#assoc_mapping_semantics">Motivation::Associative 31 Containers::Mapping Semantics</a>).</p> 32<h2><a name="results" id="results">Results</a></h2> 33<p>Figures <a href="#NTG">NTG</a>, <a href="#NTM">NTM</a>, and 34 <a href="#NTL">NTL</a> show the results for "multimaps" which 35 use a tree-based container for primary keys, in <a href="assoc_performance_tests.html#gcc"><u>g++</u></a>, <a href="assoc_performance_tests.html#msvc"><u>msvc++</u></a>, and 36 <a href="assoc_performance_tests.html#local"><u>local</u></a>, 37 respectively; Figures <a href="#NHG"></a>NHG, <a href="#NHM">NHM</a>, and <a href="#NHL">NHL</a> show the results for 38 "multimaps" which use a hash-based container for primary keys, 39 in <a href="assoc_performance_tests.html#gcc"><u>g++</u></a>, 40 <a href="assoc_performance_tests.html#msvc"><u>msvc++</u></a>, 41 and <a href="assoc_performance_tests.html#local"><u>local</u></a>, 42 respectively.</p> 43<div id="NTG_res_div"> 44<div id="NTG_gcc"> 45<div id="NTG_multimap_text_insert_mem_usage_test_large_s2p_tree"> 46<div id="NTG_assoc"> 47<div id="NHG_Native_and_primary_tree-based_multimap_types_mem_usage_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NTG" id="NTG"><img src="multimap_text_insert_mem_usage_test_large_s2p_tree_gcc.png" alt="no image" /></a></h6>NTG: NHG Native and primary tree-based multimap types mem usage 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> 48<ol> 49<li> 50rb_tree_mmap_cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set- 51<a href="tree.html"><tt>tree</tt></a> 52 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a> 53, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a> 54, mapping each key to <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a> 55with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a> 56, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a> 57 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a> 58, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a> 59 with <i>α<sub>min</sub></i> = <i>1/8</i> and <i>α<sub>max</sub></i> = <i>1/2</i></li> 60<li> 61n_mmap- 62<tt>std::multimap</tt></li> 63<li> 64rb_tree_mmap_lu_mtf_set- 65<a href="tree.html"><tt>tree</tt></a> 66 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a> 67, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a> 68, mapping each key to <a href="list_update.html"><tt>list_update</tt></a> 69 with <tt>Update_Policy</tt> = <a href="move_to_front_lu_policy.html"><tt>move_to_front_lu_policy</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="NTM_res_div"> 78<div id="NTM_msvc"> 79<div id="NTM_multimap_text_insert_mem_usage_test_large_s2p_tree"> 80<div id="NTM_assoc"> 81<div id="NHM_Native_and_primary_tree-based_multimap_types_mem_usage_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NTM" id="NTM"><img src="multimap_text_insert_mem_usage_test_large_s2p_tree_msvc.png" alt="no image" /></a></h6>NTM: NHM Native and primary tree-based multimap types mem usage 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> 82<ol> 83<li> 84n_mmap- 85<tt>std::multimap</tt></li> 86<li> 87rb_tree_mmap_cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set- 88<a href="tree.html"><tt>tree</tt></a> 89 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a> 90, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a> 91, mapping each key to <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a> 92with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a> 93, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a> 94 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a> 95, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a> 96 with <i>α<sub>min</sub></i> = <i>1/8</i> and <i>α<sub>max</sub></i> = <i>1/2</i></li> 97<li> 98rb_tree_mmap_lu_mtf_set- 99<a href="tree.html"><tt>tree</tt></a> 100 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a> 101, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a> 102, mapping each key to <a href="list_update.html"><tt>list_update</tt></a> 103 with <tt>Update_Policy</tt> = <a href="move_to_front_lu_policy.html"><tt>move_to_front_lu_policy</tt></a> 104</li> 105</ol> 106</div><div style="width: 100%; height: 20px"></div></div> 107</div> 108</div> 109</div> 110</div> 111<div id="NTL_res_div"> 112<div id="NTL_local"> 113<div id="NTL_multimap_text_insert_mem_usage_test_large_s2p_tree"> 114<div id="NTL_assoc"> 115<div id="NTL_Native_and_primary_tree-based_multimap_types_mem_usage_test"><div style = "border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NTL" id= "NTL"><img src="multimap_text_insert_mem_usage_test_large_s2p_tree_local.png" alt="no image" /></a></h6>NTL: Native and primary tree-based multimap types mem usage test - <a href = "assoc_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div> 116</div> 117</div> 118</div> 119</div> 120<div id="NHG_res_div"> 121<div id="NHG_gcc"> 122<div id="NHG_multimap_text_insert_mem_usage_test_large_s2p_hash"> 123<div id="NHG_assoc"> 124<div id="NHG_Native_and_primary_hash-based_multimap_types_mem_usage_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NHG" id="NHG"><img src="multimap_text_insert_mem_usage_test_large_s2p_hash_gcc.png" alt="no image" /></a></h6>NHG: Native and primary hash-based multimap types mem usage 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> 125<ol> 126<li> 127cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_mmap_cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set- 128<a href="cc_hash_table.html"><tt>cc_hash_table</tt></a> 129with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a> 130, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a> 131 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a> 132, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a> 133 with <i>α<sub>min</sub></i> = <i>1/8</i> and <i>α<sub>max</sub></i> = <i>1/2</i>, mapping each key to <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a> 134with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a> 135, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a> 136 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a> 137, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a> 138 with <i>α<sub>min</sub></i> = <i>1/8</i> and <i>α<sub>max</sub></i> = <i>1/2</i></li> 139<li> 140n_hash_mmap- 141<tt>__gnucxx::hash_multimap</tt></li> 142<li> 143cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_mmap_lu_mtf_set- 144<a href="cc_hash_table.html"><tt>cc_hash_table</tt></a> 145with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a> 146, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a> 147 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a> 148, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a> 149 with <i>α<sub>min</sub></i> = <i>1/8</i> and <i>α<sub>max</sub></i> = <i>1/2</i>, mapping each key to <a href="list_update.html"><tt>list_update</tt></a> 150 with <tt>Update_Policy</tt> = <a href="move_to_front_lu_policy.html"><tt>move_to_front_lu_policy</tt></a> 151</li> 152</ol> 153</div><div style="width: 100%; height: 20px"></div></div> 154</div> 155</div> 156</div> 157</div> 158<div id="NHM_res_div"> 159<div id="NHM_msvc"> 160<div id="NHM_multimap_text_insert_mem_usage_test_large_s2p_hash"> 161<div id="NHM_assoc"> 162<div id="NHM_Native_and_primary_hash-based_multimap_types_mem_usage_test"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NHM" id="NHM"><img src="multimap_text_insert_mem_usage_test_large_s2p_hash_msvc.png" alt="no image" /></a></h6>NHM: Native and primary hash-based multimap types mem usage 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> 163<ol> 164<li> 165n_hash_mmap- 166<tt>stdext::hash_multimap</tt></li> 167<li> 168cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_mmap_cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set- 169<a href="cc_hash_table.html"><tt>cc_hash_table</tt></a> 170with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a> 171, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a> 172 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a> 173, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a> 174 with <i>α<sub>min</sub></i> = <i>1/8</i> and <i>α<sub>max</sub></i> = <i>1/2</i>, mapping each key to <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a> 175with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a> 176, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a> 177 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a> 178, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a> 179 with <i>α<sub>min</sub></i> = <i>1/8</i> and <i>α<sub>max</sub></i> = <i>1/2</i></li> 180<li> 181cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_mmap_lu_mtf_set- 182<a href="cc_hash_table.html"><tt>cc_hash_table</tt></a> 183with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a> 184, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a> 185 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a> 186, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a> 187 with <i>α<sub>min</sub></i> = <i>1/8</i> and <i>α<sub>max</sub></i> = <i>1/2</i>, mapping each key to <a href="list_update.html"><tt>list_update</tt></a> 188 with <tt>Update_Policy</tt> = <a href="move_to_front_lu_policy.html"><tt>move_to_front_lu_policy</tt></a> 189</li> 190</ol> 191</div><div style="width: 100%; height: 20px"></div></div> 192</div> 193</div> 194</div> 195</div> 196<div id="NHL_res_div"> 197<div id="NHL_local"> 198<div id="NHL_multimap_text_insert_mem_usage_test_large_s2p_hash"> 199<div id="NHL_assoc"> 200<div id="NHL__Native_and_primary_hash-based_multimap_types_mem_usage_test"><div style = "border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NHL" id= "NHL"><img src="multimap_text_insert_mem_usage_test_large_s2p_hash_local.png" alt="no image" /></a></h6>NHL: Native and primary hash-based multimap types mem usage test - <a href = "assoc_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div> 201</div> 202</div> 203</div> 204</div> 205<h2><a name="observations" id="observations">Observations</a></h2> 206<p>See <a href="assoc_performance_tests.html#msc">Observations::Mapping-Semantics 207 Considerations</a>.</p> 208</div> 209</body> 210</html> 211