summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--benchmarks/tail-latency/btree_insert_dist.cpp77
m---------external/psudb-common0
3 files changed, 82 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c332448..7f3cde7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -295,6 +295,11 @@ if (tail_bench)
target_link_libraries(fixed_shard_count PUBLIC gsl pthread atomic)
target_include_directories(fixed_shard_count PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include)
target_link_options(fixed_shard_count PUBLIC -mcx16)
+
+ add_executable(btree_insert_dist ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/tail-latency/btree_insert_dist.cpp)
+ target_link_libraries(btree_insert_dist PUBLIC gsl pthread atomic)
+ target_include_directories(btree_insert_dist PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include)
+ target_link_options(btree_insert_dist PUBLIC -mcx16)
endif()
if (bench)
diff --git a/benchmarks/tail-latency/btree_insert_dist.cpp b/benchmarks/tail-latency/btree_insert_dist.cpp
new file mode 100644
index 0000000..af60819
--- /dev/null
+++ b/benchmarks/tail-latency/btree_insert_dist.cpp
@@ -0,0 +1,77 @@
+/*
+ *
+ */
+
+#define ENABLE_TIMER
+
+#include "shard/ISAMTree.h"
+#include "query/rangequery.h"
+#include "framework/interface/Record.h"
+#include "file_util.h"
+#include "benchmark_types.h"
+
+#include <gsl/gsl_rng.h>
+
+#include "psu-util/timer.h"
+#include "standard_benchmarks.h"
+#include "psu-ds/BTree.h"
+
+typedef btree_record<int64_t, int64_t> Rec;
+
+typedef de::ISAMTree<Rec> Shard;
+typedef de::irs::Query<Shard> Q;
+typedef Q::Parameters QP;
+
+void usage(char *progname) {
+ fprintf(stderr, "%s reccnt datafile queryfile\n", progname);
+}
+
+int main(int argc, char **argv) {
+
+ if (argc < 4) {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ size_t n = atol(argv[1]);
+ std::string d_fname = std::string(argv[2]);
+ std::string q_fname = std::string(argv[3]);
+
+ auto btree = BenchBTree();
+
+ auto data = read_sosd_file<Rec>(d_fname, n);
+
+ /* read in the range queries and add sample size and rng for sampling */
+ auto queries = read_range_queries<QP>(q_fname, .0001);
+
+ /* warmup structure w/ 10% of records */
+ size_t warmup = .1 * n;
+ for (size_t i=0; i<warmup; i++) {
+ btree.insert(data[i]);
+ }
+
+ TIMER_INIT();
+ /* insertion benchmark */
+ for (size_t i=warmup; i<data.size(); i++) {
+ TIMER_START();
+ btree.insert(data[i]);
+ TIMER_STOP();
+
+ fprintf(stdout, "I\t%ld\n", TIMER_RESULT());
+ }
+
+ /* run queries */
+ size_t total = 0;
+ for (size_t j=0; j<10; j++) {
+ for (size_t i=0; i<queries.size(); i++) {
+ TIMER_START();
+ total += btree.range_count(queries[i].lower_bound, queries[i].upper_bound);
+ TIMER_STOP();
+
+ fprintf(stdout, "Q\t%ld\n", TIMER_RESULT());
+ }
+ }
+
+ fprintf(stderr, "%ld\n", total);
+}
+
diff --git a/external/psudb-common b/external/psudb-common
-Subproject 3be9caf90a12b6ac3afd4437ddd62167ba6d28b
+Subproject ce3b373b75c28098df83ec95234a90cb4f4d364