summaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2024-01-22 13:33:11 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2024-01-22 13:33:11 -0500
commitdea7f559c4fa5cd603ce23d66c3c1b9311adc1cb (patch)
tree235a5be9a17c375b5c5b96d08100152d8facc47b /benchmarks
parentb1e4182825e6c162571b7cc4efaf8bc44055b49c (diff)
downloaddynamic-extension-dea7f559c4fa5cd603ce23d66c3c1b9311adc1cb.tar.gz
WAtermark testing benchmark
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/watermark_testing.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/benchmarks/watermark_testing.cpp b/benchmarks/watermark_testing.cpp
new file mode 100644
index 0000000..1abe7f5
--- /dev/null
+++ b/benchmarks/watermark_testing.cpp
@@ -0,0 +1,53 @@
+/*
+ *
+ */
+
+#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<int64_t, int64_t> Rec;
+typedef de::ISAMTree<Rec> ISAM;
+typedef de::rq::Query<ISAM, Rec> Q;
+typedef de::DynamicExtension<Rec, ISAM, Q> Ext;
+
+
+
+int main(int argc, char **argv) {
+ std::vector hwms = {5000l, 10000l, 20000l, 50000l};
+ std::vector lwms = {.1, .2, .3, .4, .5};
+
+ size_t n = 1000000;
+
+ TIMER_INIT();
+
+ for (auto &hwm : hwms) {
+ for (size_t i=0; i<lwms.size(); i++) {
+ size_t lwm = hwm * lwms[i];
+
+ auto extension = new Ext(lwm, hwm, 8);
+ TIMER_START();
+ for (int64_t i=0; i<n; i++) {
+ Rec r = {i, i};
+ while (!extension->insert(r)) {
+ _mm_pause();
+ }
+ }
+ TIMER_STOP();
+
+ auto insert_time = TIMER_RESULT();
+ double insert_throughput = (double) n / (double) insert_time * 1e9;
+
+ fprintf(stdout, "%ld\t%ld\t%lf\n", lwm, hwm, insert_throughput);
+
+ delete extension;
+ }
+ }
+}
+