summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2011-08-15 00:51:06 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2011-08-15 00:51:06 +0000
commit154c4a088e477b9154a0ba8540aeafe06d2ce1f3 (patch)
tree1afac503467fda38566f42d6fa96af4e0b6f200e /libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc
parent675bc3526eddeb97e1d992eec8ec9bb812f98c38 (diff)
downloadgcc-154c4a088e477b9154a0ba8540aeafe06d2ce1f3.tar.gz
make_graph_test_infos.xml: Edit.
2011-08-14 Benjamin Kosnik <bkoz@redhat.com> * testsuite/data/make_graph_test_infos.xml: Edit. * testsuite/data/make_graph_htmls.xml: Remove * scripts/make_graph.py: Edit, fix. * scripts/make_graphs.py: Remove. * doc/Makefile.am (doc-svg-performance): New. (doc-html-performance): Remove. * doc/Makefile.in: Regenerate. * doc/xml/manual/test_policy_data_structures.xml: Markup changes. * doc/xml/manual/policy_data_structures.xml: Same. * doc/xml/manual/locale.xml: Same. Testsuite renames. * performance/ext/pb_ds/priority_queue_text_modify_down_timing.cc: Rename. * performance/ext/pb_ds/random_int_find_timing.cc: Same. * performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * performance/ext/pb_ds/multimap_text_find_timing.hpp * performance/ext/pb_ds/priority_queue_random_int_push_timing.cc: Same. * performance/ext/pb_ds/priority_queue_text_modify_timing.hpp * performance/ext/pb_ds/tree_order_statistics_timing.cc: Same. * performance/ext/pb_ds/multimap_text_insert_mem_usage_large.cc: Same. * performance/ext/pb_ds/priority_queue_text_push_pop_timing.cc: Same. * performance/ext/pb_ds/priority_queue_text_join_timing.cc: Same. * performance/ext/pb_ds/multimap_text_insert_timing_small.cc: Same. * performance/ext/pb_ds/random_int_subscript_insert_timing.cc: Same. * performance/ext/pb_ds/tree_text_lor_find_timing.cc: Same. * performance/ext/pb_ds/priority_queue_text_pop_mem_usage.cc: Same. * performance/ext/pb_ds/multimap_text_find_timing_small.cc: Same. * performance/ext/pb_ds/text_find_timing.cc: Same. * performance/ext/pb_ds/tree_text_insert_timing.cc: Same. * performance/ext/pb_ds/hash_random_int_erase_mem_usage.cc: Same. * performance/ext/pb_ds/random_int_subscript_find_timing.cc: Same. * performance/ext/pb_ds/priority_queue_text_push_timing.cc: Same. * performance/ext/pb_ds/tree_split_join_timing.cc: Same. * performance/ext/pb_ds/multimap_text_insert_timing_large.cc: Same. * performance/ext/pb_ds/priority_queue_text_modify_up_timing.cc: Same. * performance/ext/pb_ds/multimap_text_find_timing_large.cc: Same. * performance/ext/pb_ds/priority_queue_random_int_push_pop_timing.cc: Same. * performance/ext/pb_ds/multimap_text_insert_timing.hpp * performance/ext/pb_ds/multimap_text_insert_mem_usage_small.cc: Same. * performance/ext/pb_ds/hash_zlob_random_int_find_timing.cc: Same. * performance/ext/pb_ds/all_int_find.cc: To these new files... * performance/ext/pb_ds/all_int_subscript_find.cc: ...this. * performance/ext/pb_ds/all_int_subscript_insert.cc: ...this. * performance/ext/pb_ds/all_text_find.cc: ...this. * performance/ext/pb_ds/hash_int_erase_mem.cc: ...this. * performance/ext/pb_ds/hash_zlob_int_find.cc: ...this. * performance/ext/pb_ds/multimap_text_find.hpp * performance/ext/pb_ds/multimap_text_find_large.cc: ...this. * performance/ext/pb_ds/multimap_text_find_small.cc: ...this. * performance/ext/pb_ds/multimap_text_insert.hpp * performance/ext/pb_ds/multimap_text_insert_large.cc: ...this. * performance/ext/pb_ds/multimap_text_insert_mem.hpp * performance/ext/pb_ds/multimap_text_insert_mem_large.cc: ...this. * performance/ext/pb_ds/multimap_text_insert_mem_small.cc: ...this. * performance/ext/pb_ds/multimap_text_insert_small.cc: ...this. * performance/ext/pb_ds/priority_queue_int_push.cc: ...this. * performance/ext/pb_ds/priority_queue_int_push_pop.cc: ...this. * performance/ext/pb_ds/priority_queue_text_join.cc: ...this. * performance/ext/pb_ds/priority_queue_text_modify_down.cc: ...this. * performance/ext/pb_ds/priority_queue_text_modify.hpp * performance/ext/pb_ds/priority_queue_text_modify_up.cc: ...this. * performance/ext/pb_ds/priority_queue_text_pop_mem.cc: ...this. * performance/ext/pb_ds/priority_queue_text_push.cc: ...this. * performance/ext/pb_ds/priority_queue_text_push_pop.cc: ...this. * performance/ext/pb_ds/tree_order_statistics.cc: ...this. * performance/ext/pb_ds/tree_split_join.cc: ...this. * performance/ext/pb_ds/tree_text_insert.cc: ...this. * performance/ext/pb_ds/tree_text_lor_find.cc: ...this. * doc/xml/images/*: Image and image filename changes. From-SVN: r177756
Diffstat (limited to 'libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc')
-rw-r--r--libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc115
1 files changed, 115 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc
new file mode 100644
index 00000000000..dc205547d76
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc
@@ -0,0 +1,115 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file tree_text_lor_find_timing_test.cpp
+ * Contains test for finding text with locality of reference.
+ */
+
+#include <ext/typelist.h>
+#include <performance/io/xml_formatter.hpp>
+#include <io/verified_cmd_line_input.hpp>
+#include <common_type/assoc/common_type.hpp>
+#include <performance/assoc/timing/find_test.hpp>
+#include <io/text_populate.hpp>
+#include <native_type/native_map.hpp>
+#include <iostream>
+#include <vector>
+
+void
+usage();
+
+int
+main(int argc, char* a_p_argv[])
+{
+ using namespace __gnu_pbds::test;
+
+ std::string f_name = "thirty_years_among_the_dead_preproc.txt";
+ size_t vn = 200;
+ size_t vs = 200;
+ size_t vm = 2100;
+
+ try
+ {
+ xml_test_performance_formatter fmt("Size", "Average time (sec.)");
+
+ typedef std::vector<std::pair<std::string, char> > vec_t;
+ vec_t a_v(vm);
+ text_populate(f_name, a_v);
+
+ typedef find_test<vec_t::const_iterator, true> test_t;
+ vec_t::const_iterator b = a_v.begin();
+ test_t tst(b, b, vn, vs, vm, vn, vs, vm);
+ {
+ typedef native_map<std::string, char> native_set_t;
+ tst(native_set_t());
+ }
+
+ {
+ typedef tree_common_types<std::string, char>::performance_tl tree_tl_t;
+ tree_tl_t tl;
+ __gnu_cxx::typelist::apply(tst, tl);
+ }
+ }
+ catch(...)
+ {
+ std::cerr << "Test failed" << std::endl;
+ return -1;
+ }
+ return 0;
+}
+
+void
+usage()
+{
+ using namespace std;
+ cerr << "usage: tree_text_lor_find_performance_test <f_name> <vn> <vs> <vm>"
+ << endl << endl;
+
+ cerr <<
+ "This test checks the performance of various associative containers "
+ "using their find method. " << endl;
+ cerr << "Specifically, it does the following:" << endl;
+ cerr << "* Creates a vector of text words " << endl;
+ cerr << "* Inserts the elements into the container" << endl;
+ cerr << "* Performs a sequence of find operations. At each iteration, "
+ "it finds, for each word in the vector, its entry in the "
+ "container, using the find method" << endl;
+ cerr << "* Repeats the above test a number of times" << endl;
+
+ cerr << endl << endl;
+
+ cerr << "f_name = file name containing the text words. "
+ "Each line should contain one word." << endl;
+ cerr << "vn = minimum size of the vector" << endl;
+ cerr << "vs = step size of the vector" << endl;
+ cerr << "vm = maximum size of the vector" << endl;
+}