aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/docs/html/ext/pb_ds/tree_text_insert_timing_test.html
blob: 6f0e26c00d6bb533a9400ffbb500571808773a5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" />
<title>Tree Text Insert Timing Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
</head>
<body>
<div id="page">
<h1>Tree-Based and Trie-Based Text Insert Timing Test</h1>
<h2><a name="description" id="description">Description</a></h2>
<p>This test inserts a number of values with keys from an
    arbitrary text ([ <a href="references.html#wickland96thirty">wickland96thirty</a> ]) into
    a container using <tt>insert</tt> . It measures the average
    time for <tt>insert</tt> as a function of the number of values
    inserted.</p>
<p>(The test was executed with <a href="../../../../testsuite/performance/ext/pb_ds/tree_text_insert_timing.cc"><tt>tree_text_insert_timing_test</tt></a>
    thirty_years_among_the_dead_preproc.txt 200 200 2100)</p>
<h2><a name="purpose" id="purpose">Purpose</a></h2>
<p>The test checks the effect of different underlying
    data structures.</p>
<h2><a name="results" id="results">Results</a></h2>
<p>Figures <a href="#NNTG">NNTG</a>, <a href="#NVTG">NVTG</a>,
    and <a href="#NPTG">NPTG</a> show the results for the native
    tree and <tt>pb_ds</tt>'s node-based trees, the native tree and
    <tt>pb_ds</tt>'s vector-based trees, and the native tree
    and<tt>pb_ds</tt>'s PATRICIA-trie, respectively, in <a href="assoc_performance_tests.html#gcc"><u>g++</u></a>; Figures
    <a href="#NNTM">NNTM</a>, <a href="#NVTM">NVTM</a>, and
    <a href="#NPTM">NPTM</a> show the same in <a href="assoc_performance_tests.html#msvc"><u>msvc++</u></a>; Figures
    <a href="#NNTL">NNTL</a>, <a href="#NVTL">NVTL</a>, and
    <a href="#NPTL">NPTL</a> show the same in <a href="assoc_performance_tests.html#local"><u>local</u></a>.</p>
<div id="NNTG_res_div">
<div id="NNTG_gcc">
<div id="NNTG_tree_text_insert_timing_test_node_tree">
<div id="NNTG_assoc">
<div id="NNTG_Native_tree_and_node-based_trees_text_insert_timing_test_using__tt_insert_455tt_"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NNTG" id="NNTG"><img src="tree_text_insert_timing_test_node_tree_gcc.png" alt="no image" /></a></h6>NNTG: Native tree and node-based trees text insert timing test using <tt>insert</tt> - <a href="assoc_performance_tests.html#gcc">g++</a><p>In the above figure, the names in the legends have the following meaning:</p>
<ol>
<li>
splay_tree_map-
<a href="tree.html"><tt>tree</tt></a>
 with <tt>Tag</tt> = <a href="splay_tree_tag.html"><tt>splay_tree_tag</tt></a>
, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
</li>
<li>
n_map-
<tt>std::map</tt></li>
<li>
rb_tree_map-
<a href="tree.html"><tt>tree</tt></a>
 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a>
, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
</li>
</ol>
</div><div style="width: 100%; height: 20px"></div></div>
</div>
</div>
</div>
</div>
<div id="NVTG_res_div">
<div id="NVTG_gcc">
<div id="NVTG_tree_text_insert_timing_test_vector_tree">
<div id="NVTG_assoc">
<div id="NVTG_Native_tree_and_vector-based_tree_text_insert_timing_test_using__tt_insert_455tt_"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NVTG" id="NVTG"><img src="tree_text_insert_timing_test_vector_tree_gcc.png" alt="no image" /></a></h6>NVTG: Native tree and vector-based tree text insert timing test using <tt>insert</tt> - <a href="assoc_performance_tests.html#gcc">g++</a><p>In the above figure, the names in the legends have the following meaning:</p>
<ol>
<li>
ov_tree_map-
<a href="tree.html"><tt>tree</tt></a>
 with <tt>Tag</tt> = <a href="ov_tree_tag.html"><tt>ov_tree_tag</tt></a>
, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
</li>
<li>
n_map-
<tt>std::map</tt></li>
</ol>
</div><div style="width: 100%; height: 20px"></div></div>
</div>
</div>
</div>
</div>
<div id="NPTG_res_div">
<div id="NPTG_gcc">
<div id="NPTG_tree_text_insert_timing_test_pat_trie">
<div id="NPTG_assoc">
<div id="NPTG_Native_tree_and_PATRICIA_trie_text_insert_timing_test_using__tt_insert_455tt_"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NPTG" id="NPTG"><img src="tree_text_insert_timing_test_pat_trie_gcc.png" alt="no image" /></a></h6>NPTG: Native tree and PATRICIA trie text insert timing test using <tt>insert</tt> - <a href="assoc_performance_tests.html#gcc">g++</a><p>In the above figure, the names in the legends have the following meaning:</p>
<ol>
<li>
n_map-
<tt>std::map</tt></li>
<li>
pat_trie_map-
<a href="trie.html"><tt>trie</tt></a>
 with <tt>Tag</tt> = <a href="pat_trie_tag.html"><tt>pat_trie_tag</tt></a>
, and <tt>Node_Update</tt> = <a href="null_trie_node_update.html"><tt>null_trie_node_update</tt></a>
</li>
</ol>
</div><div style="width: 100%; height: 20px"></div></div>
</div>
</div>
</div>
</div>
<div id="NNTM_res_div">
<div id="NNTM_msvc">
<div id="NNTM_tree_text_insert_timing_test_node_tree">
<div id="NNTM_assoc">
<div id="NNTM_Native_tree_and_node-based_trees_text_insert_timing_test_using__tt_insert_455tt_"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NNTM" id="NNTM"><img src="tree_text_insert_timing_test_node_tree_msvc.png" alt="no image" /></a></h6>NNTM: Native tree and node-based trees text insert timing test using <tt>insert</tt> - <a href="assoc_performance_tests.html#msvc">msvc++</a><p>In the above figure, the names in the legends have the following meaning:</p>
<ol>
<li>
splay_tree_map-
<a href="tree.html"><tt>tree</tt></a>
 with <tt>Tag</tt> = <a href="splay_tree_tag.html"><tt>splay_tree_tag</tt></a>
, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
</li>
<li>
n_map-
<tt>std::map</tt></li>
<li>
rb_tree_map-
<a href="tree.html"><tt>tree</tt></a>
 with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a>
, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
</li>
</ol>
</div><div style="width: 100%; height: 20px"></div></div>
</div>
</div>
</div>
</div>
<div id="NVTM_res_div">
<div id="NVTM_msvc">
<div id="NVTM_tree_text_insert_timing_test_vector_tree">
<div id="NVTM_assoc">
<div id="NVTM_Native_tree_and_vector-based_tree_text_insert_timing_test_using__tt_insert_455tt_"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NVTM" id="NVTM"><img src="tree_text_insert_timing_test_vector_tree_msvc.png" alt="no image" /></a></h6>NVTM: Native tree and vector-based tree text insert timing test using <tt>insert</tt> - <a href="assoc_performance_tests.html#msvc">msvc++</a><p>In the above figure, the names in the legends have the following meaning:</p>
<ol>
<li>
ov_tree_map-
<a href="tree.html"><tt>tree</tt></a>
 with <tt>Tag</tt> = <a href="ov_tree_tag.html"><tt>ov_tree_tag</tt></a>
, and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
</li>
<li>
n_map-
<tt>std::map</tt></li>
</ol>
</div><div style="width: 100%; height: 20px"></div></div>
</div>
</div>
</div>
</div>
<div id="NPTM_res_div">
<div id="NPTM_msvc">
<div id="NPTM_tree_text_insert_timing_test_pat_trie">
<div id="NPTM_assoc">
<div id="NPTM_Native_tree_and_PATRICIA_trie_text_insert_timing_test_using__tt_insert_455tt_"><div style="border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NPTM" id="NPTM"><img src="tree_text_insert_timing_test_pat_trie_msvc.png" alt="no image" /></a></h6>NPTM: Native tree and PATRICIA trie text insert timing test using <tt>insert</tt> - <a href="assoc_performance_tests.html#msvc">msvc++</a><p>In the above figure, the names in the legends have the following meaning:</p>
<ol>
<li>
pat_trie_map-
<a href="trie.html"><tt>trie</tt></a>
 with <tt>Tag</tt> = <a href="pat_trie_tag.html"><tt>pat_trie_tag</tt></a>
, and <tt>Node_Update</tt> = <a href="null_trie_node_update.html"><tt>null_trie_node_update</tt></a>
</li>
<li>
n_map-
<tt>std::map</tt></li>
</ol>
</div><div style="width: 100%; height: 20px"></div></div>
</div>
</div>
</div>
</div>
<div id="NNTL_res_div">
<div id="NNTL_local">
<div id="NNTL_tree_text_insert_timing_test_node_tree">
<div id="NNTL_assoc">
<div id="NNTL_Native_tree_and_node-based_trees_text_insert_timing_test_using__tt_insert_455tt_"><div style = "border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NNTL" id= "NNTL"><img src="tree_text_insert_timing_test_node_tree_local.png" alt="no image" /></a></h6>NNTL: Native tree and node-based trees text insert timing test using <tt>insert</tt> - <a href = "assoc_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
</div>
</div>
</div>
</div>
<div id="NVTL_res_div">
<div id="NVTL_local">
<div id="NVTL_tree_text_insert_timing_test_vector_tree">
<div id="NVTL_assoc">
<div id="NVTL_Native_tree_and_vector-based_tree_text_insert_timing_test_using__tt_insert_455tt_"><div style = "border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NVTL" id= "NVTL"><img src="tree_text_insert_timing_test_vector_tree_local.png" alt="no image" /></a></h6>NVTL: Native tree and vector-based tree text insert timing test using <tt>insert</tt> - <a href = "assoc_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
</div>
</div>
</div>
</div>
<div id="NPTL_res_div">
<div id="NPTL_local">
<div id="NPTL_tree_text_insert_timing_test_pat_trie">
<div id="NPTL_assoc">
<div id="NPTL_Native_tree_and_PATRICIA_trie_text_insert_timing_test_using__tt_insert_455tt_"><div style = "border-style: dotted; border-width: 1px; border-color: lightgray"><h6 class="c1"><a name="NPTL" id= "NPTL"><img src="tree_text_insert_timing_test_pat_trie_local.png" alt="no image" /></a></h6>NPTL: Native tree and PATRICIA trie text insert timing test using <tt>insert</tt> - <a href = "assoc_performance_tests.html#local">local</a></div><div style = "width: 100%; height: 20px"></div></div>
</div>
</div>
</div>
</div>
<h2><a name="observations" id="observations">Observations</a></h2>
<p>Observing Figure <a href="#NNTG">NNTG</a> , for this
    setting, a splay tree, ( <a href="tree.html"><tt>tree</tt></a>
    with <tt>Tag =</tt> <a href="splay_tree_tag.html"><tt>splay_tree_tag</tt></a> ) does
    not do well. This was covered in <a href="tree_text_find_find_timing_test.html">Tree-Based and
    Trie-Based Text <tt>find</tt> Find Timing Test</a> . The two
    red-black trees perform better.</p>
<p>Observing Figure <a href="#NVTG">NVTG</a>, an ordered-vector
    tree ( <a href="tree.html"><tt>tree</tt></a>
    with <tt>Tag =</tt> <a href="ov_tree_tag.html"><tt>ov_tree_tag</tt></a>) performs
    abysmally. Inserting into this type of tree has linear
    complexity [ <a href="references.html#austern00noset">austern00noset</a>].</p>
<p>Observing Figure <a href="#NPTG">NPTG</a> , A PATRICIA trie
    ( <a href="trie.html"><tt>trie</tt></a>
    with <tt>Tag =</tt> <a href="pat_trie_tag.html"><tt>pat_trie_tag</tt></a> ) has
    abysmal performance, as well. This is not that surprising,
    since a large-fan-out PATRICIA trie works like a hash table with
    collisions resolved by a sub-trie. Each time a collision is
    encountered, a new "hash-table" is built A large fan-out
    PATRICIA trie, however, doe does well in look-ups (see <a href="tree_text_find_find_timing_test.html">Tree-Based and
    Trie-Based Text <tt>find</tt> Find Timing Test</a> ). It is
    possibly beneficial to semi-static settings, therefore.</p>
<p><a href="assoc_performance_tests.html#tree_like_based_types">Observations::Tree-Like-Based
    Container Types</a> summarizes some observations on tree-based
    and trie-based containers.</p>
</div>
</body>
</html>