From f24fdf2fd310a5f868e15cd9682ca37d740c77af Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Tue, 30 Jan 2024 15:31:03 -0500 Subject: Benchmarking updates --- benchmarks/insert_tail_latency.cpp | 80 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 benchmarks/insert_tail_latency.cpp (limited to 'benchmarks/insert_tail_latency.cpp') diff --git a/benchmarks/insert_tail_latency.cpp b/benchmarks/insert_tail_latency.cpp new file mode 100644 index 0000000..5e32898 --- /dev/null +++ b/benchmarks/insert_tail_latency.cpp @@ -0,0 +1,80 @@ +/* + * + */ + +#define ENABLE_TIMER + +#include + +#include "framework/DynamicExtension.h" +#include "shard/ISAMTree.h" +#include "query/rangecount.h" +#include "framework/interface/Record.h" +#include +#include + +#include "psu-util/timer.h" + + +typedef de::Record Rec; +typedef de::ISAMTree ISAM; +typedef de::rc::Query Q; +typedef de::DynamicExtension Ext; + +std::atomic total_latency = 0; + +void insert_thread(Ext *extension, size_t n, size_t k, size_t rate) { + int64_t delay = (1.0 / (double) rate) * 10e6; // delay in us + TIMER_INIT(); + for (int64_t i=0; iinsert(r)) { + _mm_pause(); + } + + //usleep(delay); + /* + for (size_t i=0; i<10000; i++) { + __asm__ __volatile__ ("":::"memory"); + } + */ + } + TIMER_STOP(); + + auto insert_lat = TIMER_RESULT(); + + total_latency.fetch_add(insert_lat); + fprintf(stdout, "I\t%ld\t%ld\t%ld\n", i+k, insert_lat, k); + } +} + +int main(int argc, char **argv) { + + /* the closeout routine takes _forever_ ... so we'll just leak the memory */ + auto extension = new Ext(100, 1000000, 3); + size_t n = 100000000; + size_t per_trial = 1000; + double selectivity = .001; + size_t rate = 1000000; + + total_latency.store(0); + + gsl_rng * rng = gsl_rng_alloc(gsl_rng_mt19937); + + std::thread i_thrd1(insert_thread, extension, n/2, per_trial, rate); + std::thread i_thrd2(insert_thread, extension, n/2, per_trial, rate); + + i_thrd1.join(); + i_thrd2.join(); + + auto avg_latency = total_latency.load() / n; + auto throughput = (int64_t) ((double) n / (double) total_latency * 1e9); + + fprintf(stdout, "AVG LAT: %ld\nThroughput: %ld\n", avg_latency, throughput); + + gsl_rng_free(rng); + fflush(stderr); +} + -- cgit v1.2.3 From d166465dcca3550cb8f3263e0f5b5189a69d531a Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 31 Jan 2024 13:29:49 -0500 Subject: Temporary thread affinity for reconstruction --- benchmarks/insert_tail_latency.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'benchmarks/insert_tail_latency.cpp') diff --git a/benchmarks/insert_tail_latency.cpp b/benchmarks/insert_tail_latency.cpp index 5e32898..1640ce5 100644 --- a/benchmarks/insert_tail_latency.cpp +++ b/benchmarks/insert_tail_latency.cpp @@ -19,7 +19,7 @@ typedef de::Record Rec; typedef de::ISAMTree ISAM; typedef de::rc::Query Q; -typedef de::DynamicExtension Ext; +typedef de::DynamicExtension Ext; std::atomic total_latency = 0; @@ -53,8 +53,8 @@ void insert_thread(Ext *extension, size_t n, size_t k, size_t rate) { int main(int argc, char **argv) { /* the closeout routine takes _forever_ ... so we'll just leak the memory */ - auto extension = new Ext(100, 1000000, 3); - size_t n = 100000000; + auto extension = new Ext(12000, 12001, 3); + size_t n = 10000000; size_t per_trial = 1000; double selectivity = .001; size_t rate = 1000000; @@ -63,11 +63,12 @@ int main(int argc, char **argv) { gsl_rng * rng = gsl_rng_alloc(gsl_rng_mt19937); - std::thread i_thrd1(insert_thread, extension, n/2, per_trial, rate); - std::thread i_thrd2(insert_thread, extension, n/2, per_trial, rate); + std::thread i_thrd1(insert_thread, extension, n, per_trial, rate); + //std::thread i_thrd2(insert_thread, extension, n/2, per_trial, rate); + i_thrd1.join(); - i_thrd2.join(); + //i_thrd2.join(); auto avg_latency = total_latency.load() / n; auto throughput = (int64_t) ((double) n / (double) total_latency * 1e9); -- cgit v1.2.3 From 2c5d549b3618b9ea72e6eece4cb4f3da5a6811a8 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 7 Feb 2024 13:42:34 -0500 Subject: Fully realized shard concept interface --- benchmarks/insert_tail_latency.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'benchmarks/insert_tail_latency.cpp') diff --git a/benchmarks/insert_tail_latency.cpp b/benchmarks/insert_tail_latency.cpp index 1640ce5..bdc4536 100644 --- a/benchmarks/insert_tail_latency.cpp +++ b/benchmarks/insert_tail_latency.cpp @@ -18,7 +18,7 @@ typedef de::Record Rec; typedef de::ISAMTree ISAM; -typedef de::rc::Query Q; +typedef de::rc::Query Q; typedef de::DynamicExtension Ext; std::atomic total_latency = 0; -- cgit v1.2.3