From 6bdcf74ad91e0efaa8c2e4339f5085fde8a7982b Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Sat, 5 Apr 2025 19:08:12 -0400 Subject: working commit (temporary progress, doesn't build) --- benchmarks/tail-latency/insert_query_threads.cpp | 125 +++++++++++------------ 1 file changed, 60 insertions(+), 65 deletions(-) (limited to 'benchmarks/tail-latency/insert_query_threads.cpp') diff --git a/benchmarks/tail-latency/insert_query_threads.cpp b/benchmarks/tail-latency/insert_query_threads.cpp index 759de5d..1188ce0 100644 --- a/benchmarks/tail-latency/insert_query_threads.cpp +++ b/benchmarks/tail-latency/insert_query_threads.cpp @@ -39,7 +39,7 @@ typedef de::DEConfiguration idx; std::atomic inserts_done = false; -ssize_t query_ratio = 8; +ssize_t query_ratio = 0; std::atomic total_res = 0; size_t reccnt = 0; @@ -72,22 +72,10 @@ void insert_thread(Ext *extension, std::vector *records, size_t start_idx, TIMER_INIT(); TIMER_START(); - for (size_t i=start_idx; iprint_structure(); - while (!extension->insert((*records)[i])) { usleep(1); - //fprintf(stderr, "[D] Failed to insert\n"); } - - //fprintf(stderr, "[D] Record inserted\n"); - - if (extension->get_record_count() != i + 1) { - fprintf(stderr, "[E]: invalid record count %ld %ld\n", extension->get_record_count(), i+1); - extension->print_structure(); - exit(EXIT_FAILURE); - } } TIMER_STOP(); @@ -115,81 +103,88 @@ int main(int argc, char **argv) { std::vector sfs = {8}; //, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; size_t buffer_size = 8000; std::vector policies = { - 5 + 0 }; - std::vector thread_counts = {8}; + std::vector thread_counts = {1}; + std::vector modifiers = {0, 1, 2, 3}; size_t insert_threads = 1; - size_t query_threads = 16; + size_t query_threads = 0; reccnt = n; for (auto pol : policies) { 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 = internal_thread_cnt; - - g_thrd_cnt = internal_thread_cnt; - - total_insert_time.store(0); - total_query_time.store(0); - total_query_count.store(0); - - auto extension = new Ext(std::move(config)); - - /* warmup structure w/ 10% of records */ - size_t warmup = 0 * n; - for (size_t k = 0; k < warmup; k++) { - while (!extension->insert(data[k])) { - usleep(1); + for (auto mod : modifiers) { + auto policy = get_policy(sfs[0], buffer_size, pol, n, mod); + 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 = internal_thread_cnt; + + g_thrd_cnt = internal_thread_cnt; + + total_insert_time.store(0); + total_query_time.store(0); + total_query_count.store(0); + + auto extension = new Ext(std::move(config)); + + /* warmup structure w/ 10% of records */ + size_t warmup = 0 * n; + for (size_t k = 0; k < warmup; k++) { + while (!extension->insert(data[k])) { + usleep(1); + } } - } - extension->await_version(); + extension->await_version(); - idx.store(warmup); + idx.store(warmup); - std::thread i_thrds[insert_threads]; - std::thread q_thrds[query_threads]; + std::thread i_thrds[insert_threads]; + std::thread q_thrds[query_threads]; - size_t per_insert_thrd = (n - warmup) / insert_threads; - size_t start = warmup; + size_t per_insert_thrd = (n - warmup) / insert_threads; + size_t start = warmup; - for (size_t i=0; i