From fee53096fb95c01649d8f06f4528bd7f65529450 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Tue, 21 Jan 2025 13:11:12 -0500 Subject: BTree insertion latency benchmarks --- benchmarks/tail-latency/btree_insert_dist.cpp | 77 +++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 benchmarks/tail-latency/btree_insert_dist.cpp (limited to 'benchmarks/tail-latency/btree_insert_dist.cpp') 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 + +#include "psu-util/timer.h" +#include "standard_benchmarks.h" +#include "psu-ds/BTree.h" + +typedef btree_record Rec; + +typedef de::ISAMTree Shard; +typedef de::irs::Query 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(d_fname, n); + + /* read in the range queries and add sample size and rng for sampling */ + auto queries = read_range_queries(q_fname, .0001); + + /* warmup structure w/ 10% of records */ + size_t warmup = .1 * n; + for (size_t i=0; i