From 9864552a3f2b533c47076a7f6efe246e77deb440 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 26 Jun 2023 10:09:46 -0400 Subject: Added static benchmarking --- benchmarks/include/bench.h | 41 ++++++++++++++++++++++++++++++++++++++ benchmarks/triespline_rq_bench.cpp | 8 ++++++++ 2 files changed, 49 insertions(+) (limited to 'benchmarks') diff --git a/benchmarks/include/bench.h b/benchmarks/include/bench.h index 6a9c263..db8fc77 100644 --- a/benchmarks/include/bench.h +++ b/benchmarks/include/bench.h @@ -108,3 +108,44 @@ static bool query_latency_bench(DE &de_index, std::vector queries, size_t tr return true; } + + +template +static bool static_latency_bench(Shard *shard, std::vector queries, size_t trial_cnt=100) { + char progbuf[25]; + if constexpr (PROGRESS) { + sprintf(progbuf, "querying:"); + } + + size_t total_time = 0; + size_t total_results = 0; + + for (size_t i=0; i states(1); + + auto start = std::chrono::high_resolution_clock::now(); + for (size_t j=0; j(stop - start).count(); + } + + progress_update(1.0, progbuf); + + size_t query_latency = total_time / (trial_cnt * queries.size()); + + fprintf(stdout, "%ld\t", query_latency); + fflush(stdout); + + return true; +} diff --git a/benchmarks/triespline_rq_bench.cpp b/benchmarks/triespline_rq_bench.cpp index cc7bae4..9ee8ad9 100644 --- a/benchmarks/triespline_rq_bench.cpp +++ b/benchmarks/triespline_rq_bench.cpp @@ -45,8 +45,16 @@ int main(int argc, char **argv) insert_tput_bench(de, datafile, insert_cnt, delete_prop, to_delete); query_latency_bench>(de, queries); + + auto ts = de.create_static_structure(); + + static_latency_bench, Rec, de::ts_range_query_parms, de::TrieSplineRangeQuery>( + ts, queries + ); fprintf(stdout, "\n"); + delete ts; + delete_bench_env(); fflush(stdout); fflush(stderr); -- cgit v1.2.3