PageRenderTime 28ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/pizzafactory/pf-gcc
HTML | 226 lines | 225 code | 1 blank | 0 comment | 0 complexity | 6df7d35e5835149e8d8fd633329bdebd 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 Insert 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>Tree-Based and Trie-Based Text Insert Timing 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 using <tt>insert</tt> . It measures the average
  16. time for <tt>insert</tt> as a function of the number of values
  17. inserted.</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/tree_text_insert_timing.cc"><tt>tree_text_insert_timing_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.</p>
  23. <h2><a name="results" id="results">Results</a></h2>
  24. <p>Figures <a href="#NNTG">NNTG</a>, <a href="#NVTG">NVTG</a>,
  25. and <a href="#NPTG">NPTG</a> show the results for the native
  26. tree and <tt>pb_ds</tt>'s node-based trees, the native tree and
  27. <tt>pb_ds</tt>'s vector-based trees, and the native tree
  28. and<tt>pb_ds</tt>'s PATRICIA-trie, respectively, in <a href="assoc_performance_tests.html#gcc"><u>g++</u></a>; Figures
  29. <a href="#NNTM">NNTM</a>, <a href="#NVTM">NVTM</a>, and
  30. <a href="#NPTM">NPTM</a> show the same in <a href="assoc_performance_tests.html#msvc"><u>msvc++</u></a>; Figures
  31. <a href="#NNTL">NNTL</a>, <a href="#NVTL">NVTL</a>, and
  32. <a href="#NPTL">NPTL</a> show the same in <a href="assoc_performance_tests.html#local"><u>local</u></a>.</p>
  33. <div id="NNTG_res_div">
  34. <div id="NNTG_gcc">
  35. <div id="NNTG_tree_text_insert_timing_test_node_tree">
  36. <div id="NNTG_assoc">
  37. <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>
  38. <ol>
  39. <li>
  40. splay_tree_map-
  41. <a href="tree.html"><tt>tree</tt></a>
  42. with <tt>Tag</tt> = <a href="splay_tree_tag.html"><tt>splay_tree_tag</tt></a>
  43. , and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
  44. </li>
  45. <li>
  46. n_map-
  47. <tt>std::map</tt></li>
  48. <li>
  49. rb_tree_map-
  50. <a href="tree.html"><tt>tree</tt></a>
  51. with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a>
  52. , and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
  53. </li>
  54. </ol>
  55. </div><div style="width: 100%; height: 20px"></div></div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div id="NVTG_res_div">
  61. <div id="NVTG_gcc">
  62. <div id="NVTG_tree_text_insert_timing_test_vector_tree">
  63. <div id="NVTG_assoc">
  64. <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>
  65. <ol>
  66. <li>
  67. ov_tree_map-
  68. <a href="tree.html"><tt>tree</tt></a>
  69. with <tt>Tag</tt> = <a href="ov_tree_tag.html"><tt>ov_tree_tag</tt></a>
  70. , and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
  71. </li>
  72. <li>
  73. n_map-
  74. <tt>std::map</tt></li>
  75. </ol>
  76. </div><div style="width: 100%; height: 20px"></div></div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div id="NPTG_res_div">
  82. <div id="NPTG_gcc">
  83. <div id="NPTG_tree_text_insert_timing_test_pat_trie">
  84. <div id="NPTG_assoc">
  85. <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>
  86. <ol>
  87. <li>
  88. n_map-
  89. <tt>std::map</tt></li>
  90. <li>
  91. pat_trie_map-
  92. <a href="trie.html"><tt>trie</tt></a>
  93. with <tt>Tag</tt> = <a href="pat_trie_tag.html"><tt>pat_trie_tag</tt></a>
  94. , and <tt>Node_Update</tt> = <a href="null_trie_node_update.html"><tt>null_trie_node_update</tt></a>
  95. </li>
  96. </ol>
  97. </div><div style="width: 100%; height: 20px"></div></div>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <div id="NNTM_res_div">
  103. <div id="NNTM_msvc">
  104. <div id="NNTM_tree_text_insert_timing_test_node_tree">
  105. <div id="NNTM_assoc">
  106. <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>
  107. <ol>
  108. <li>
  109. splay_tree_map-
  110. <a href="tree.html"><tt>tree</tt></a>
  111. with <tt>Tag</tt> = <a href="splay_tree_tag.html"><tt>splay_tree_tag</tt></a>
  112. , and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
  113. </li>
  114. <li>
  115. n_map-
  116. <tt>std::map</tt></li>
  117. <li>
  118. rb_tree_map-
  119. <a href="tree.html"><tt>tree</tt></a>
  120. with <tt>Tag</tt> = <a href="rb_tree_tag.html"><tt>rb_tree_tag</tt></a>
  121. , and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
  122. </li>
  123. </ol>
  124. </div><div style="width: 100%; height: 20px"></div></div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <div id="NVTM_res_div">
  130. <div id="NVTM_msvc">
  131. <div id="NVTM_tree_text_insert_timing_test_vector_tree">
  132. <div id="NVTM_assoc">
  133. <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>
  134. <ol>
  135. <li>
  136. ov_tree_map-
  137. <a href="tree.html"><tt>tree</tt></a>
  138. with <tt>Tag</tt> = <a href="ov_tree_tag.html"><tt>ov_tree_tag</tt></a>
  139. , and <tt>Node_Update</tt> = <a href="null_tree_node_update.html"><tt>null_tree_node_update</tt></a>
  140. </li>
  141. <li>
  142. n_map-
  143. <tt>std::map</tt></li>
  144. </ol>
  145. </div><div style="width: 100%; height: 20px"></div></div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. <div id="NPTM_res_div">
  151. <div id="NPTM_msvc">
  152. <div id="NPTM_tree_text_insert_timing_test_pat_trie">
  153. <div id="NPTM_assoc">
  154. <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>
  155. <ol>
  156. <li>
  157. pat_trie_map-
  158. <a href="trie.html"><tt>trie</tt></a>
  159. with <tt>Tag</tt> = <a href="pat_trie_tag.html"><tt>pat_trie_tag</tt></a>
  160. , and <tt>Node_Update</tt> = <a href="null_trie_node_update.html"><tt>null_trie_node_update</tt></a>
  161. </li>
  162. <li>
  163. n_map-
  164. <tt>std::map</tt></li>
  165. </ol>
  166. </div><div style="width: 100%; height: 20px"></div></div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. <div id="NNTL_res_div">
  172. <div id="NNTL_local">
  173. <div id="NNTL_tree_text_insert_timing_test_node_tree">
  174. <div id="NNTL_assoc">
  175. <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>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. <div id="NVTL_res_div">
  181. <div id="NVTL_local">
  182. <div id="NVTL_tree_text_insert_timing_test_vector_tree">
  183. <div id="NVTL_assoc">
  184. <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>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <div id="NPTL_res_div">
  190. <div id="NPTL_local">
  191. <div id="NPTL_tree_text_insert_timing_test_pat_trie">
  192. <div id="NPTL_assoc">
  193. <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>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <h2><a name="observations" id="observations">Observations</a></h2>
  199. <p>Observing Figure <a href="#NNTG">NNTG</a> , for this
  200. setting, a splay tree, ( <a href="tree.html"><tt>tree</tt></a>
  201. with <tt>Tag =</tt> <a href="splay_tree_tag.html"><tt>splay_tree_tag</tt></a> ) does
  202. not do well. This was covered in <a href="tree_text_find_find_timing_test.html">Tree-Based and
  203. Trie-Based Text <tt>find</tt> Find Timing Test</a> . The two
  204. red-black trees perform better.</p>
  205. <p>Observing Figure <a href="#NVTG">NVTG</a>, an ordered-vector
  206. tree ( <a href="tree.html"><tt>tree</tt></a>
  207. with <tt>Tag =</tt> <a href="ov_tree_tag.html"><tt>ov_tree_tag</tt></a>) performs
  208. abysmally. Inserting into this type of tree has linear
  209. complexity [ <a href="references.html#austern00noset">austern00noset</a>].</p>
  210. <p>Observing Figure <a href="#NPTG">NPTG</a> , A PATRICIA trie
  211. ( <a href="trie.html"><tt>trie</tt></a>
  212. with <tt>Tag =</tt> <a href="pat_trie_tag.html"><tt>pat_trie_tag</tt></a> ) has
  213. abysmal performance, as well. This is not that surprising,
  214. since a large-fan-out PATRICIA trie works like a hash table with
  215. collisions resolved by a sub-trie. Each time a collision is
  216. encountered, a new "hash-table" is built A large fan-out
  217. PATRICIA trie, however, doe does well in look-ups (see <a href="tree_text_find_find_timing_test.html">Tree-Based and
  218. Trie-Based Text <tt>find</tt> Find Timing Test</a> ). It is
  219. possibly beneficial to semi-static settings, therefore.</p>
  220. <p><a href="assoc_performance_tests.html#tree_like_based_types">Observations::Tree-Like-Based
  221. Container Types</a> summarizes some observations on tree-based
  222. and trie-based containers.</p>
  223. </div>
  224. </body>
  225. </html>