From f1316e313de5c5286b279cec6ed320cba3eb506f Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 17 Feb 2025 16:40:11 -0500 Subject: Average version of mixed-workload bench --- benchmarks/tail-latency/mixed_workload.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'benchmarks/tail-latency/mixed_workload.cpp') diff --git a/benchmarks/tail-latency/mixed_workload.cpp b/benchmarks/tail-latency/mixed_workload.cpp index 517ccd8..f4bfdda 100644 --- a/benchmarks/tail-latency/mixed_workload.cpp +++ b/benchmarks/tail-latency/mixed_workload.cpp @@ -43,7 +43,7 @@ size_t query_ratio = 3; std::atomic total_res = 0; size_t reccnt = 0; -size_t thrd_cnt = 0; +size_t g_thrd_cnt = 0; void operation_thread(Ext *extension, std::vector *queries, std::vector *records) { @@ -60,7 +60,7 @@ void operation_thread(Ext *extension, std::vector *queries, auto res = extension->query(std::move(q)).get(); TIMER_STOP(); - fprintf(stdout, "Q\t%ld\t%ld\n", thrd_cnt, TIMER_RESULT()); + fprintf(stdout, "Q\t%ld\t%ld\n", g_thrd_cnt, TIMER_RESULT()); total_res.fetch_add(res); @@ -78,7 +78,7 @@ void operation_thread(Ext *extension, std::vector *queries, } TIMER_STOP(); - fprintf(stdout, "I\t%ld\t%ld\n", thrd_cnt, TIMER_RESULT()); + fprintf(stdout, "I\t%ld\t%ld\n", g_thrd_cnt, TIMER_RESULT()); if (idx.load() == reccnt) { inserts_done.store(true); @@ -117,22 +117,22 @@ int main(int argc, char **argv) { reccnt = n; for (auto pol : policies) { - for (size_t i = 0; i < thread_counts.size(); i++) { + for (auto internal_thread_cnt : thread_counts) { auto policy = get_policy(sfs[0], buffer_size, pol, n); auto config = Conf(std::move(policy)); config.recon_enable_maint_on_flush = true; config.recon_maint_disabled = false; config.buffer_flush_trigger = 4000; - config.maximum_threads = thread_counts[i]; + config.maximum_threads = internal_thread_cnt; - thrd_cnt = thread_counts[i]; + g_thrd_cnt = internal_thread_cnt; auto extension = new Ext(std::move(config)); /* warmup structure w/ 10% of records */ size_t warmup = .1 * n; - for (size_t j = 0; j < warmup; j++) { - while (!extension->insert(data[j])) { + for (size_t k = 0; k < warmup; k++) { + while (!extension->insert(data[k])) { usleep(1); } } @@ -153,6 +153,8 @@ int main(int argc, char **argv) { } fprintf(stderr, "%ld\n", total_res.load()); + total_res.store(0); + inserts_done.store(false); delete extension; } } -- cgit v1.2.3