summaryrefslogtreecommitdiffstats
path: root/benchmarks/insertion_tput.cpp
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2023-11-15 15:18:56 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2023-11-15 15:18:56 -0500
commit3680667a07d924043c5da7bba8a11883bb918b97 (patch)
tree9ea179b6a8bc03974a10e6e0221bd67c739e2ba0 /benchmarks/insertion_tput.cpp
parentfe12926c41eed825da80a36d77b7facd9ba0567a (diff)
downloaddynamic-extension-3680667a07d924043c5da7bba8a11883bb918b97.tar.gz
Insertion throughput benchmark
Diffstat (limited to 'benchmarks/insertion_tput.cpp')
-rw-r--r--benchmarks/insertion_tput.cpp49
1 files changed, 49 insertions, 0 deletions
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<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) {
+
+ auto extension = Ext(1000, 2, 1);
+
+ size_t n = 1000000;
+ size_t per_trial = 100;
+
+ std::vector<int64_t> latencies;
+
+ TIMER_INIT();
+ for (int64_t i=0; i<n; i+=per_trial) {
+ TIMER_START();
+ for (int64_t j=0; j<per_trial; j++) {
+ Rec r = {i+j, i+j};
+ extension.insert(r);
+ }
+ TIMER_STOP();
+
+ auto res = TIMER_RESULT();
+
+ latencies.push_back(TIMER_RESULT());
+ }
+
+ for (size_t i=0; i<latencies.size(); i++) {
+ fprintf(stdout, "%ld\t%ld\t%ld\n", (1+i)*per_trial, latencies[i], per_trial);
+ }
+}
+