Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

speedtest: moving selective running of some b+tree slots configurations.

  • Loading branch information...
commit e3ec254d700dbf0b400cc582ba6fd8d5861b8567 1 parent 71359e9
@bingmann authored
View
33 speedtest/flags-build.sh
@@ -1,33 +0,0 @@
-#!/bin/bash -x
-
-build_flag() {
- local subdir="$1"
- local CXX="$2"
- local extraflags="$3"
-
- local stdflags='-DPACKAGE_NAME="stx-btree" -DPACKAGE_TARNAME="stx-btree" -DPACKAGE_VERSION="0.8.6" -DPACKAGE="stx-btree" -DVERSION="0.8.6" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDBOOL_H=1'
-
- stdflags="$stdflags -I. -I../include -g -W -Wall -Wold-style-cast -DNDEBUG"
-
- mkdir $subdir
-
- $CXX $stdflags $extraflags -o $subdir/speedtest speedtest.cc || exit
-
- strip -s $subdir/speedtest
-}
-
-build_flag "gcc-O0" "g++" "-O0"
-build_flag "gcc-O1" "g++" "-O1"
-build_flag "gcc-O2" "g++" "-O2"
-build_flag "gcc-O2-ofp" "g++" "-O2 -fomit-frame-pointer"
-build_flag "gcc-O3" "g++" "-O3"
-build_flag "gcc-O3-ofp" "g++" "-O3 -fomit-frame-pointer"
-build_flag "gcc-Os" "g++" "-Os"
-
-build_flag "gcc-O3-i686-ofp" "g++" "-O3 -march=i686 -fomit-frame-pointer"
-
-build_flag "icc-O0" "icc" "-O0"
-build_flag "icc-O1" "icc" "-O1"
-build_flag "icc-O2" "icc" "-O2"
-build_flag "icc-O3" "icc" "-O3"
-build_flag "icc-Os" "icc" "-Os"
View
13 speedtest/flags-run.sh
@@ -1,13 +0,0 @@
-#!/bin/bash -x
-
-for subdir in [gi]cc*; do
-
- pushd $subdir
-
- if [ ! -e speed-all.txt ]; then
- ./speedtest
- fi
-
- popd
-
-done
View
48 speedtest/speedtest.cc
@@ -280,8 +280,18 @@ 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)
+void testrunner_loop(std::ostream& os, unsigned int items, int slots)
{
+#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;
@@ -321,7 +331,7 @@ struct btree_range
{
inline void operator()(std::ostream& os, unsigned int items)
{
- testrunner_loop< functional<Low> >(os, items);
+ testrunner_loop< functional<Low> >(os, items, Low);
btree_range<functional, Low+2, High>()(os, items);
}
};
@@ -331,7 +341,7 @@ struct btree_range<functional, Low, Low>
{
inline void operator()(std::ostream& os, unsigned int items)
{
- testrunner_loop< functional<Low> >(os, items);
+ testrunner_loop< functional<Low> >(os, items, Low);
}
};
@@ -340,21 +350,11 @@ void TestFactory_Set<TestClass>::call_testrunner(std::ostream& os, unsigned int
{
os << items << " " << std::flush;
- testrunner_loop<StdSet>(os, items);
- testrunner_loop<HashSet>(os, items);
- testrunner_loop<UnorderedSet>(os, items);
+ testrunner_loop<StdSet>(os, items, 0);
+ testrunner_loop<HashSet>(os, items, 0);
+ testrunner_loop<UnorderedSet>(os, items, 0);
-#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);
- testrunner_loop< BtreeSet<8> >(os, items);
- testrunner_loop< BtreeSet<16> >(os, items);
- testrunner_loop< BtreeSet<32> >(os, items);
- testrunner_loop< BtreeSet<64> >(os, items);
- testrunner_loop< BtreeSet<128> >(os, items);
-#endif
os << "\n" << std::flush;
}
@@ -364,21 +364,11 @@ void TestFactory_Map<TestClass>::call_testrunner(std::ostream& os, unsigned int
{
os << items << " " << std::flush;
- testrunner_loop<StdMap>(os, items);
- testrunner_loop<HashMap>(os, items);
- testrunner_loop<UnorderedMap>(os, items);
+ testrunner_loop<StdMap>(os, items, 0);
+ testrunner_loop<HashMap>(os, items, 0);
+ testrunner_loop<UnorderedMap>(os, items, 0);
-#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);
- testrunner_loop< BtreeMap<8> >(os, items);
- testrunner_loop< BtreeMap<16> >(os, items);
- testrunner_loop< BtreeMap<32> >(os, items);
- testrunner_loop< BtreeMap<64> >(os, items);
- testrunner_loop< BtreeMap<128> >(os, items);
-#endif
os << "\n" << std::flush;
}
Please sign in to comment.
Something went wrong with that request. Please try again.