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>"Multimap" Text Insert Timing Test with Small Average
8  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 Insert Timing Test with Small 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 400 distinct primary keys, and the ratio of secondary keys
25    to primary keys ranges from 1 to 5.</p>
26<p>The test measures the average insert-time as a function of
27    the number of values inserted. For <tt>pb_ds</tt>'s containers,
28    it inserts a primary key into the primary associative
29    container, then a secondary key into the secondary associative
30    container. For the native multimaps, it obtains a range using
31    <tt>std::equal_range</tt>, and inserts a value only if it was
32    not contained already.</p>
33<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_timing_small.cc"><tt>multimap_text_insert_timing_test</tt></a>
34    thirty_years_among_the_dead_preproc.txt 400 1 1 6)</p>
35<h2><a name="purpose" id="purpose">Purpose</a></h2>
36<p>The test checks the insert-time scalability of different
37    "multimap" designs (see <a href="motivation.html#assoc_mapping_semantics">Motivation::Associative
38    Containers::Alternative to Multiple Equivalent Keys</a>).</p>
39<h2><a name="results" id="results">Results</a></h2>
40<p>Figures <a href="#NTG">NTG</a>, <a href="#NTM">NTM</a>, and
41    <a href="#NTL">NTL</a> show the results for "multimaps" which
42    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
43    <a href="assoc_performance_tests.html#local"><u>local</u></a>,
44    respectively; Figures <a href="#NHG"></a>NHG, <a href="#NHM">NHM</a>, and <a href="#NHL">NHL</a> show the results for
45    "multimaps" which use a hash-based container for primary keys,
46    in <a href="assoc_performance_tests.html#gcc"><u>g++</u></a>,
47    <a href="assoc_performance_tests.html#msvc"><u>msvc++</u></a>,
48    and <a href="assoc_performance_tests.html#local"><u>local</u></a>,
49    respectively.</p>
50<div id="NTG_res_div">
51<div id="NTG_gcc">
52<div id="NTG_multimap_text_insert_timing_test_small_s2p_tree">
53<div id="NTG_assoc">
54<div id="NTG_Native_and_primary_tree-based_multimap_types_insert_timing_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_timing_test_small_s2p_tree_gcc.png" alt="no image" /></a></h6>NTG: Native and primary tree-based multimap types insert timing 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>
55<ol>
56<li>
57n_mmap-
58<tt>std::multimap</tt></li>
59<li>
60rb_tree_mmap_cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set-
61<a href="tree.html"><tt>tree</tt></a>
62 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a>
63, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
64, mapping each key to <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
65with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
66, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
67 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
68, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
69 with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i></li>
70<li>
71rb_tree_mmap_lu_mtf_set-
72<a href="tree.html"><tt>tree</tt></a>
73 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a>
74, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
75, mapping each key to <a href="list_update.html"><tt>list_update</tt></a>
76 with <tt>Update_Policy</tt> = <a href="move_to_front_lu_policy.html"><tt>move_to_front_lu_policy</tt></a>
77</li>
78</ol>
79</div><div style="width: 100%; height: 20px"></div></div>
80</div>
81</div>
82</div>
83</div>
84<div id="NTM_res_div">
85<div id="NTM_msvc">
86<div id="NTM_multimap_text_insert_timing_test_small_s2p_tree">
87<div id="NTM_assoc">
88<div id="NHM_Native_and_primary_tree-based_multimap_types_insert_timing_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_timing_test_small_s2p_tree_msvc.png" alt="no image" /></a></h6>NTM: NHM Native and primary tree-based multimap types insert timing 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>
89<ol>
90<li>
91rb_tree_mmap_cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set-
92<a href="tree.html"><tt>tree</tt></a>
93 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a>
94, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
95, mapping each key to <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
96with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
97, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
98 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
99, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
100 with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i></li>
101<li>
102n_mmap-
103<tt>std::multimap</tt></li>
104<li>
105rb_tree_mmap_lu_mtf_set-
106<a href="tree.html"><tt>tree</tt></a>
107 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a>
108, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
109, mapping each key to <a href="list_update.html"><tt>list_update</tt></a>
110 with <tt>Update_Policy</tt> = <a href="move_to_front_lu_policy.html"><tt>move_to_front_lu_policy</tt></a>
111</li>
112</ol>
113</div><div style="width: 100%; height: 20px"></div></div>
114</div>
115</div>
116</div>
117</div>
118<div id="NTL_res_div">
119<div id="NTL_local">
120<div id="NTL_multimap_text_insert_timing_test_small_s2p_tree">
121<div id="NTL_assoc">
122<div id="NTL_Native_and_primary_tree-based_multimap_types_insert_timing_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_timing_test_small_s2p_tree_local.png" alt="no image" /></a></h6>NTL: Native and primary tree-based multimap types insert timing test - <a href = "assoc_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
123</div>
124</div>
125</div>
126</div>
127<div id="NHG_res_div">
128<div id="NHG_gcc">
129<div id="NHG_multimap_text_insert_timing_test_small_s2p_hash">
130<div id="NHG_assoc">
131<div id="NHG_Native_and_primary_hash-based_multimap_types_insert_timing_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_timing_test_small_s2p_hash_gcc.png" alt="no image" /></a></h6>NHG: Native and primary hash-based multimap types insert timing 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>
132<ol>
133<li>
134n_hash_mmap-
135<tt>__gnucxx::hash_multimap</tt></li>
136<li>
137cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_mmap_cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set-
138<a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
139with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
140, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
141 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
142, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
143 with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i>, mapping each key to <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
144with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
145, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
146 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
147, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
148 with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i></li>
149<li>
150cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_mmap_lu_mtf_set-
151<a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
152with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
153, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
154 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
155, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
156 with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i>, mapping each key to <a href="list_update.html"><tt>list_update</tt></a>
157 with <tt>Update_Policy</tt> = <a href="move_to_front_lu_policy.html"><tt>move_to_front_lu_policy</tt></a>
158</li>
159</ol>
160</div><div style="width: 100%; height: 20px"></div></div>
161</div>
162</div>
163</div>
164</div>
165<div id="NHM_res_div">
166<div id="NHM_msvc">
167<div id="NHM_multimap_text_insert_timing_test_small_s2p_hash">
168<div id="NHM_assoc">
169<div id="NHM_Native_and_primary_hash-based_multimap_types_insert_timing_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_timing_test_small_s2p_hash_msvc.png" alt="no image" /></a></h6>NHM: Native and primary hash-based multimap types insert timing 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>
170<ol>
171<li>
172cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_mmap_cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_set-
173<a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
174with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
175, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
176 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
177, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
178 with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i>, mapping each key to <a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
179with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
180, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
181 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
182, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
183 with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i></li>
184<li>
185n_hash_mmap-
186<tt>stdext::hash_multimap</tt></li>
187<li>
188cc_hash_mask_exp_nea_lc_1div8_1div2_nsth_mmap_lu_mtf_set-
189<a href="cc_hash_table.html"><tt>cc_hash_table</tt></a>
190with <tt>Comb_Hash_Fn</tt> = <a href="direct_mask_range_hashing.html"><tt>direct_mask_range_hashing</tt></a>
191, and <tt>Resize_Policy</tt> = <a href="hash_standard_resize_policy.html"><tt>hash_standard_resize_policy</tt></a>
192 with <tt>Size_Policy</tt> = <a href="hash_exponential_size_policy.html"><tt>hash_exponential_size_policy</tt></a>
193, and <tt>Trigger_Policy</tt> = <a href="hash_load_check_resize_trigger.html"><tt>hash_load_check_resize_trigger</tt></a>
194 with <i>&alpha;<sub>min</sub></i> = <i>1/8</i> and <i>&alpha;<sub>max</sub></i> = <i>1/2</i>, mapping each key to <a href="list_update.html"><tt>list_update</tt></a>
195 with <tt>Update_Policy</tt> = <a href="move_to_front_lu_policy.html"><tt>move_to_front_lu_policy</tt></a>
196</li>
197</ol>
198</div><div style="width: 100%; height: 20px"></div></div>
199</div>
200</div>
201</div>
202</div>
203<div id="NHL_res_div">
204<div id="NHL_local">
205<div id="NHL_multimap_text_insert_timing_test_small_s2p_hash">
206<div id="NHL_assoc">
207<div id="NHL_Native_and_primary_hash-based_multimap_types_insert_timing_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_timing_test_small_s2p_hash_local.png" alt="no image" /></a></h6>NHL: Native and primary hash-based multimap types insert timing test - <a href = "assoc_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
208</div>
209</div>
210</div>
211</div>
212<h2><a name="observations" id="observations">Observations</a></h2>
213<p>See <a href="assoc_performance_tests.html#msc">Observations::Mapping-Semantics
214    Considerations</a>.</p>
215</div>
216</body>
217</html>
218