Skip to content
Browse files

Again changing speedtest compilation for testing only specific node s…

…izes.
  • Loading branch information...
1 parent 7355d40 commit 94f0689b0e9fa79041cef2505afa5c94d655e215 @bingmann committed
Showing with 43 additions and 21 deletions.
  1. +2 −2 include/stx/btree.h
  2. +41 −19 speedtest/speedtest.cc
View
4 include/stx/btree.h
@@ -1624,7 +1624,7 @@ class btree
template <typename node_type>
inline int find_lower(const node_type *n, const key_type& key) const
{
- if ( sizeof(n->slotkey) > traits::binsearch_threshold )
+ if ( 0 && sizeof(n->slotkey) > traits::binsearch_threshold )
{
if (n->slotuse == 0) return 0;
@@ -1671,7 +1671,7 @@ class btree
template <typename node_type>
inline int find_upper(const node_type *n, const key_type& key) const
{
- if ( sizeof(n->slotkey) > traits::binsearch_threshold )
+ if ( 0 && sizeof(n->slotkey) > traits::binsearch_threshold )
{
if (n->slotuse == 0) return 0;
View
60 speedtest/speedtest.cc
@@ -280,18 +280,8 @@ unsigned int repeatuntil;
/// Repeat (short) tests until enough time elapsed and divide by the runs.
template <typename TestClass>
-void testrunner_loop(std::ostream& os, unsigned int items, int slots)
+void testrunner_loop(std::ostream& os, unsigned int items)
{
-#if 1
- // just pick a few node sizes for quicker tests
- if (slots != 0 && slots != 4 && slots != 8 &&
- slots != 16 && slots != 32 && slots != 64 && slots != 128)
- {
- os << "0 " << std::flush; // write dummy zero to align gnuplot output
- return;
- }
-#endif
-
unsigned int runs = 0;
double ts1, ts2;
@@ -331,7 +321,7 @@ struct btree_range
{
inline void operator()(std::ostream& os, unsigned int items)
{
- testrunner_loop< functional<Low> >(os, items, Low);
+ testrunner_loop< functional<Low> >(os, items);
btree_range<functional, Low+2, High>()(os, items);
}
};
@@ -341,7 +331,7 @@ struct btree_range<functional, Low, Low>
{
inline void operator()(std::ostream& os, unsigned int items)
{
- testrunner_loop< functional<Low> >(os, items, Low);
+ testrunner_loop< functional<Low> >(os, items);
}
};
@@ -350,11 +340,27 @@ void TestFactory_Set<TestClass>::call_testrunner(std::ostream& os, unsigned int
{
os << items << " " << std::flush;
- testrunner_loop<StdSet>(os, items, 0);
- testrunner_loop<HashSet>(os, items, 0);
- testrunner_loop<UnorderedSet>(os, items, 0);
+ testrunner_loop<StdSet>(os, items);
+ testrunner_loop<HashSet>(os, items);
+ testrunner_loop<UnorderedSet>(os, items);
+#if 1
btree_range<BtreeSet, min_nodeslots, max_nodeslots>()(os, items);
+#else
+ // just pick a few node sizes for quicker tests
+ testrunner_loop< BtreeSet<4> >(os, items);
+ for (int i = 5; i < 8; ++i) os << "0 ";
+ testrunner_loop< BtreeSet<8> >(os, items);
+ for (int i = 9; i < 16; ++i) os << "0 ";
+ testrunner_loop< BtreeSet<16> >(os, items);
+ for (int i = 17; i < 32; ++i) os << "0 ";
+ testrunner_loop< BtreeSet<32> >(os, items);
+ for (int i = 33; i < 64; ++i) os << "0 ";
+ testrunner_loop< BtreeSet<64> >(os, items);
+ for (int i = 65; i < 128; ++i) os << "0 ";
+ testrunner_loop< BtreeSet<128> >(os, items);
+ for (int i = 129; i <= max_nodeslots; ++i) os << "0 ";
+#endif
os << "\n" << std::flush;
}
@@ -364,11 +370,27 @@ void TestFactory_Map<TestClass>::call_testrunner(std::ostream& os, unsigned int
{
os << items << " " << std::flush;
- testrunner_loop<StdMap>(os, items, 0);
- testrunner_loop<HashMap>(os, items, 0);
- testrunner_loop<UnorderedMap>(os, items, 0);
+ testrunner_loop<StdMap>(os, items);
+ testrunner_loop<HashMap>(os, items);
+ testrunner_loop<UnorderedMap>(os, items);
+#if 1
btree_range<BtreeMap, min_nodeslots, max_nodeslots>()(os, items);
+#else
+ // just pick a few node sizes for quicker tests
+ testrunner_loop< BtreeMap<4> >(os, items);
+ for (int i = 5; i < 8; ++i) os << "0 ";
+ testrunner_loop< BtreeMap<8> >(os, items);
+ for (int i = 9; i < 16; ++i) os << "0 ";
+ testrunner_loop< BtreeMap<16> >(os, items);
+ for (int i = 17; i < 32; ++i) os << "0 ";
+ testrunner_loop< BtreeMap<32> >(os, items);
+ for (int i = 33; i < 64; ++i) os << "0 ";
+ testrunner_loop< BtreeMap<64> >(os, items);
+ for (int i = 65; i < 128; ++i) os << "0 ";
+ testrunner_loop< BtreeMap<128> >(os, items);
+ for (int i = 129; i <= max_nodeslots; ++i) os << "0 ";
+#endif
os << "\n" << std::flush;
}

0 comments on commit 94f0689

Please sign in to comment.
Something went wrong with that request. Please try again.