summaryrefslogtreecommitdiffstats
path: root/benchmarks/include/file_util.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-04-30 13:06:56 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2025-04-30 13:06:56 -0400
commitaa15300f8302bf713d752a775f32060b59b8746f (patch)
tree7520c84f04da657cc67b3a03ad7ba0448e3ac86d /benchmarks/include/file_util.h
parent81d3ef3cb4a00d566978ebca511fd947f3ef9b1b (diff)
downloaddynamic-extension-aa15300f8302bf713d752a775f32060b59b8746f.tar.gz
Stats tweaks and KNN benchmark
Diffstat (limited to 'benchmarks/include/file_util.h')
-rw-r--r--benchmarks/include/file_util.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/benchmarks/include/file_util.h b/benchmarks/include/file_util.h
index a159dbe..39b297b 100644
--- a/benchmarks/include/file_util.h
+++ b/benchmarks/include/file_util.h
@@ -149,7 +149,7 @@ static std::vector<QP> read_binary_knn_queries(std::string fname, size_t k,
}
template <typename QP>
-static std::vector<QP> read_knn_queries(std::string fname, size_t k) {
+static std::vector<QP> read_knn_queries(std::string fname, size_t k, size_t n=0) {
std::vector<QP> queries;
FILE *qf = fopen(fname.c_str(), "r");
@@ -173,6 +173,10 @@ static std::vector<QP> read_knn_queries(std::string fname, size_t k) {
query.k = k;
queries.emplace_back(query);
+
+ if (n != 0 && queries.size() == n) {
+ break;
+ }
}
free(line);