summaryrefslogtreecommitdiffstats
path: root/benchmarks/include/btree-util.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2024-01-30 15:31:03 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2024-01-30 15:31:03 -0500
commitf24fdf2fd310a5f868e15cd9682ca37d740c77af (patch)
treeb637160ce464dc05104e4ce2968e0568f550567c /benchmarks/include/btree-util.h
parent4aa907d6275b1b74be87ed2f2e94d8a2719a6a97 (diff)
downloaddynamic-extension-f24fdf2fd310a5f868e15cd9682ca37d740c77af.tar.gz
Benchmarking updates
Diffstat (limited to 'benchmarks/include/btree-util.h')
-rw-r--r--benchmarks/include/btree-util.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/benchmarks/include/btree-util.h b/benchmarks/include/btree-util.h
new file mode 100644
index 0000000..571c073
--- /dev/null
+++ b/benchmarks/include/btree-util.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include <cstdlib>
+#include "psu-ds/BTree.h"
+
+struct btree_record {
+ int64_t key;
+ int64_t value;
+
+ inline bool operator<(const btree_record& other) const {
+ return key < other.key || (key == other.key && value < other.value);
+ }
+
+ inline bool operator==(const btree_record& other) const {
+ return key == other.key && value == other.value;
+ }
+};
+
+struct btree_key_extract {
+ static const int64_t &get(const btree_record &v) {
+ return v.key;
+ }
+};
+
+typedef psudb::BTree<int64_t, btree_record, btree_key_extract> BenchBTree;
+
+