From f3211dfa5fabf30ed31ca67c23e0abb13bf9f5c5 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Tue, 13 Jun 2023 14:48:19 -0400 Subject: Triespline Range Query benchmark --- CMakeLists.txt | 4 +++ benchmarks/triespline_rq_bench.cpp | 55 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 benchmarks/triespline_rq_bench.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 864a3f4..70dffdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,4 +93,8 @@ if (bench) target_compile_options(alias_wss_bench PUBLIC -fopenmp) + add_executable(triespline_rq_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/triespline_rq_bench.cpp) + target_link_libraries(triespline_rq_bench PUBLIC gsl pthread gomp) + target_include_directories(triespline_rq_bench PRIVATE include external/PGM-index/include external/PLEX/include bench/include) + target_compile_options(triespline_rq_bench PUBLIC -fopenmp) endif() diff --git a/benchmarks/triespline_rq_bench.cpp b/benchmarks/triespline_rq_bench.cpp new file mode 100644 index 0000000..cc7bae4 --- /dev/null +++ b/benchmarks/triespline_rq_bench.cpp @@ -0,0 +1,55 @@ +/* + * benchmarks/triespline_rq_bench.cpp + * + * Copyright (C) 2023 Douglas Rumbaugh + * + * All rights reserved. Published under the Modified BSD License. + * + */ +#include "include/bench.h" + +int main(int argc, char **argv) +{ + if (argc < 5) { + fprintf(stderr, "Usage: triespline_rq_bench [osm_data]\n"); + exit(EXIT_FAILURE); + } + + std::string filename = std::string(argv[1]); + size_t record_count = atol(argv[2]); + size_t buffer_cap = 12000; + size_t scale_factor = 6; + double delete_prop = atof(argv[3]); + double max_delete_prop = (delete_prop > 0) ? delete_prop : 1; + std::string query_file = std::string(argv[4]); + bool use_osm = (argc == 6) ? atoi(argv[5]) : 0; + + double insert_batch = 0.1; + + init_bench_env(record_count, true, use_osm); + + auto de = ExtendedTSRQ(buffer_cap, scale_factor, max_delete_prop); + auto queries = read_range_queries>(query_file, .001); + + std::fstream datafile; + datafile.open(filename, std::ios::in); + + std::vector to_delete; + + // warm up the tree with initial_insertions number of initially inserted + // records + size_t warmup_cnt = insert_batch * record_count; + warmup(datafile, de, warmup_cnt, delete_prop, to_delete); + + size_t insert_cnt = record_count - warmup_cnt; + + insert_tput_bench(de, datafile, insert_cnt, delete_prop, to_delete); + query_latency_bench>(de, queries); + fprintf(stdout, "\n"); + + delete_bench_env(); + fflush(stdout); + fflush(stderr); + + exit(EXIT_SUCCESS); +} -- cgit v1.2.3