summaryrefslogtreecommitdiffstats
path: root/benchmarks/include/standard_benchmarks.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2024-04-30 14:18:08 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2024-04-30 14:18:08 -0400
commit47a386b50d904d3f1b7ce3cfc13c29ea96dd1e43 (patch)
treee37b21e18dd9977e4ba90af46605ad3b5c928b45 /benchmarks/include/standard_benchmarks.h
parentc61164545f4c113fb17eb993e393bbf97373cfb3 (diff)
downloaddynamic-extension-47a386b50d904d3f1b7ce3cfc13c29ea96dd1e43.tar.gz
Added VPTree BSM benchmark
Diffstat (limited to 'benchmarks/include/standard_benchmarks.h')
-rw-r--r--benchmarks/include/standard_benchmarks.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/benchmarks/include/standard_benchmarks.h b/benchmarks/include/standard_benchmarks.h
index aaef679..76b5f7c 100644
--- a/benchmarks/include/standard_benchmarks.h
+++ b/benchmarks/include/standard_benchmarks.h
@@ -34,6 +34,14 @@ static void run_queries(DE *extension, std::vector<QP> &queries) {
result.emplace_back(itr->data);
itr++;
}
+
+ #ifdef BENCH_PRINT_RESULTS
+ fprintf(stdout, "\n\n");
+ for (auto &r : result) {
+ fprintf(stdout, "%ld %lf %lf %lf %lf %lf %lf\n", result.size(), r.data[0],
+ r.data[1], r.data[2], r.data[3], r.data[4], r.data[5]);
+ }
+ #endif
} else if constexpr (std::is_same_v<PGM, DE>) {
size_t tot = 0;
auto ptr = extension->find(queries[i].lower_bound);
@@ -44,7 +52,26 @@ static void run_queries(DE *extension, std::vector<QP> &queries) {
} else {
auto res = extension->query(&queries[i]);
if constexpr (!BSM) {
- auto r = res.get();
+ auto result = res.get();
+ #ifdef BENCH_PRINT_RESULTS
+ fprintf(stdout, "\n\n");
+ for (int i=result.size()-1; i>=0; i--) {
+ auto &r = result[i];
+ fprintf(stdout, "%ld %lf %lf %lf %lf %lf %lf\n", result.size(), r.data[0],
+ r.data[1], r.data[2], r.data[3], r.data[4], r.data[5]);
+ }
+ fflush(stdout);
+ #endif
+ } else {
+ #ifdef BENCH_PRINT_RESULTS
+ fprintf(stdout, "\n\n");
+ for (int i=res.size()-1; i>=0; i--) {
+ auto &r = res[i];
+ fprintf(stdout, "%ld %lf %lf %lf %lf %lf %lf\n", res.size(), r.data[0],
+ r.data[1], r.data[2], r.data[3], r.data[4], r.data[5]);
+ }
+ fflush(stdout);
+ #endif
}
}
}
@@ -73,6 +100,16 @@ static void run_static_queries(S *shard, std::vector<QP> &queries) {
Q::process_query_states(q, states, nullptr);
auto res = Q::query(shard, state, q);
+
+ #ifdef BENCH_PRINT_RESULTS
+ fprintf(stdout, "\n\n");
+ for (int i=res.size()-1; i>=0; i--) {
+ auto &r = res[i].rec;
+ fprintf(stdout, "%ld %lf %lf %lf %lf %lf %lf\n", res.size(), r.data[0],
+ r.data[1], r.data[2], r.data[3], r.data[4], r.data[5]);
+ }
+ fflush(stdout);
+ #endif
}
}