From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../ext/pb_ds/tree_split_join_timing_test.html | 143 +++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 libstdc++-v3/doc/html/ext/pb_ds/tree_split_join_timing_test.html (limited to 'libstdc++-v3/doc/html/ext/pb_ds/tree_split_join_timing_test.html') diff --git a/libstdc++-v3/doc/html/ext/pb_ds/tree_split_join_timing_test.html b/libstdc++-v3/doc/html/ext/pb_ds/tree_split_join_timing_test.html new file mode 100644 index 000000000..9164984d1 --- /dev/null +++ b/libstdc++-v3/doc/html/ext/pb_ds/tree_split_join_timing_test.html @@ -0,0 +1,143 @@ + + + + + +Tree Split Join Timing Test + + + +
+

Tree Split-Join Timing Test

+

Description

+

This test a container, inserts into a number of values, + splits the container at the median, and joins the two + containers. (If the containers are one of pb_ds 's + trees, it splits and joins with the split and + join method; otherwise, it uses the erase and + insert methods.) It measures the time for splitting + and joining the containers as a function of the number of + values inserted.

+

(The test was executed with tree_split_join_timing_test + 200 200 2100)

+

Purpose

+

The test checks the performance difference of join + as opposed to a sequence of insert operations; by + implication, this test checks the most efficient way to erase a + sub-sequence from a tree-like-based container, since this can + always be performed by a small sequence of splits and joins + (see Motivation::Associative + Containers::Slightly Different Methods::Methods Related to + Split and Join and Design::Associative + Containers::Tree-Based Containers::Additional Methods + .)

+

Results

+

Figures NTG, NTM, and + NTL show the results for the native and + tree-based containers in g++, msvc++, and + local, + respectively.

+
+
+
+
+
no image
NTG: Native and tree-based container splits and joins - g++

In the above figure, the names in the legends have the following meaning:

+
    +
  1. +n_set- +std::set
  2. +
  3. +splay_tree_set- +tree + with Tag = splay_tree_tag +, and Node_Update = null_tree_node_update +
  4. +
  5. +rb_tree_set- +tree + with Tag = rb_tree_tag +, and Node_Update = null_tree_node_update +
  6. +
  7. +ov_tree_set- +tree + with Tag = ov_tree_tag +, and Node_Update = null_tree_node_update +
  8. +
+
+
+
+
+
+
+
+
+
+
no image
NTM: Native and tree-based container splits and joins - msvc++

In the above figure, the names in the legends have the following meaning:

+
    +
  1. +n_set- +std::set
  2. +
  3. +splay_tree_set- +tree + with Tag = splay_tree_tag +, and Node_Update = null_tree_node_update +
  4. +
  5. +rb_tree_set- +tree + with Tag = rb_tree_tag +, and Node_Update = null_tree_node_update +
  6. +
  7. +ov_tree_set- +tree + with Tag = ov_tree_tag +, and Node_Update = null_tree_node_update +
  8. +
+
+
+
+
+
+
+
+
+
+
no image
NTL: Native and tree-based container splits and joins - local
+
+
+
+
+

Observations

+

In this test, the native red-black trees must be split and + joined externally, through a sequence of erase and + insert operations. This is clearly super-linear, and + it is not that surprising that the cost is high.

+

pb_ds 's tree-based containers use in this test the + split and join methods, which have lower + complexity: the join method of a splay tree ( tree + with Tag = splay_tree_tag ) is + quadratic in the length of the longest root-leaf path, and + linear in the total number of elements; the join + method of a red-black tree ( tree + with Tag = rb_tree_tag ) or an + ordered-vector tree ( tree + with Tag = ov_tree_tag ) is linear + in the number of elements.

+

Asides from orders of growth, pb_ds 's trees access + their allocator very little in these operations, and some of + them do not access it at all. This leads to lower constants in + their complexity, and, for some containers, to exception-free + splits and joins (which can be determined via container_traits).

+

It is important to note that split and + join are not esoteric methods - they are the most + efficient means of erasing a contiguous range of values from a + tree based container.

+
+ + -- cgit v1.2.3