From 3680667a07d924043c5da7bba8a11883bb918b97 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 15 Nov 2023 15:18:56 -0500 Subject: Insertion throughput benchmark --- benchmarks/insertion_tput.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 benchmarks/insertion_tput.cpp (limited to 'benchmarks/insertion_tput.cpp') diff --git a/benchmarks/insertion_tput.cpp b/benchmarks/insertion_tput.cpp new file mode 100644 index 0000000..ad53443 --- /dev/null +++ b/benchmarks/insertion_tput.cpp @@ -0,0 +1,49 @@ +/* + * + */ + +#define ENABLE_TIMER + +#include "framework/DynamicExtension.h" +#include "shard/ISAMTree.h" +#include "query/rangequery.h" +#include "framework/interface/Record.h" + +#include "psu-util/timer.h" + + +typedef de::Record Rec; +typedef de::ISAMTree ISAM; +typedef de::rq::Query Q; +typedef de::DynamicExtension Ext; + + + +int main(int argc, char **argv) { + + auto extension = Ext(1000, 2, 1); + + size_t n = 1000000; + size_t per_trial = 100; + + std::vector latencies; + + TIMER_INIT(); + for (int64_t i=0; i Date: Thu, 16 Nov 2023 11:59:52 -0500 Subject: insert_tput: minor adjustments --- benchmarks/insertion_tput.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'benchmarks/insertion_tput.cpp') diff --git a/benchmarks/insertion_tput.cpp b/benchmarks/insertion_tput.cpp index ad53443..5959173 100644 --- a/benchmarks/insertion_tput.cpp +++ b/benchmarks/insertion_tput.cpp @@ -21,29 +21,24 @@ typedef de::DynamicExtension Ext; int main(int argc, char **argv) { - auto extension = Ext(1000, 2, 1); + auto extension = new Ext(10000, 2, 1); - size_t n = 1000000; - size_t per_trial = 100; - - std::vector latencies; + size_t n = 1000000000; + size_t per_trial = 1000; TIMER_INIT(); for (int64_t i=0; iinsert(r); } TIMER_STOP(); + auto insert_lat = TIMER_RESULT(); - auto res = TIMER_RESULT(); - - latencies.push_back(TIMER_RESULT()); + fprintf(stdout, "%ld\t%ld\t%ld\n", extension->get_record_count(), insert_lat, per_trial); } - for (size_t i=0; i Date: Mon, 15 Jan 2024 17:21:11 -0500 Subject: Benchmarking programs --- benchmarks/insertion_tput.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'benchmarks/insertion_tput.cpp') diff --git a/benchmarks/insertion_tput.cpp b/benchmarks/insertion_tput.cpp index 5959173..5498f93 100644 --- a/benchmarks/insertion_tput.cpp +++ b/benchmarks/insertion_tput.cpp @@ -21,7 +21,7 @@ typedef de::DynamicExtension Ext; int main(int argc, char **argv) { - auto extension = new Ext(10000, 2, 1); + auto extension = new Ext(1000, 10000, 2); size_t n = 1000000000; size_t per_trial = 1000; @@ -31,7 +31,9 @@ int main(int argc, char **argv) { TIMER_START(); for (int64_t j=0; jinsert(r); + while (!extension->insert(r)) { + _mm_pause(); + } } TIMER_STOP(); auto insert_lat = TIMER_RESULT(); -- cgit v1.2.3 From 4aa907d6275b1b74be87ed2f2e94d8a2719a6a97 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 24 Jan 2024 11:31:28 -0500 Subject: Multithreaded Insertion Benchmark --- benchmarks/insertion_tput.cpp | 48 +++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 11 deletions(-) (limited to 'benchmarks/insertion_tput.cpp') diff --git a/benchmarks/insertion_tput.cpp b/benchmarks/insertion_tput.cpp index 5498f93..785b933 100644 --- a/benchmarks/insertion_tput.cpp +++ b/benchmarks/insertion_tput.cpp @@ -18,27 +18,53 @@ typedef de::rq::Query Q; typedef de::DynamicExtension Ext; +void insert_thread(int64_t start, int64_t end, Ext *extension) { + for (int64_t i=start; iinsert(r)) { + _mm_pause(); + } + } +} + int main(int argc, char **argv) { - auto extension = new Ext(1000, 10000, 2); size_t n = 1000000000; - size_t per_trial = 1000; - TIMER_INIT(); - for (int64_t i=0; i counts = {1, 2, 4, 8}; //, 16, 32, 64}; + + + for (auto thread_count : counts) { + + auto extension = new Ext(1000, 12000, 8); + + size_t per_thread = n / thread_count; + + std::thread threads[thread_count]; + + TIMER_INIT(); TIMER_START(); - for (int64_t j=0; jinsert(r)) { - _mm_pause(); - } + for (size_t i=0; iget_record_count(), insert_lat, per_trial); + auto total_time = TIMER_RESULT(); + + double tput = (double) n / (double) total_time * 1e9; + + fprintf(stdout, "%ld\t%d\t%lf\n", extension->get_record_count(), + thread_count, tput); + + delete extension; } fflush(stderr); -- 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/insertion_tput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'benchmarks/insertion_tput.cpp') diff --git a/benchmarks/insertion_tput.cpp b/benchmarks/insertion_tput.cpp index 785b933..b4428f6 100644 --- a/benchmarks/insertion_tput.cpp +++ b/benchmarks/insertion_tput.cpp @@ -14,7 +14,7 @@ typedef de::Record Rec; typedef de::ISAMTree ISAM; -typedef de::rq::Query Q; +typedef de::rq::Query Q; typedef de::DynamicExtension Ext; -- cgit v1.2.3