Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Fix exectimer.

Kishore Nallanb78548430826
diff --git a/include/exectime.h b/include/exectime.h
index ef61c072..5b408603 100644
--- a/include/exectime.h
+++ b/include/exectime.h
@@ -4,8 +4,8 @@
#include "logger.h"
class ExecTime {
- static auto begin = std::chrono::high_resolution_clock::now();
-
+ inline static std::chrono::time_point<std::chrono::high_resolution_clock> begin;
+public:
static void start() {
begin = std::chrono::high_resolution_clock::now();
}
diff --git a/src/posting_list.cpp b/src/posting_list.cpp
index 32e74a18..3cbd0189 100644
--- a/src/posting_list.cpp
+++ b/src/posting_list.cpp
@@ -677,6 +677,8 @@ bool posting_list_t::block_intersect(const std::vector<posting_list_t*>& posting
}
iter_state.num_lists = posting_lists.size();
+ iter_state.blocks.reserve(100);
+ iter_state.indices.reserve(100);
} else {
// already in the middle of iteration: prepare for next batch
iter_state.ids.clear();
@@ -690,10 +692,6 @@ bool posting_list_t::block_intersect(const std::vector<posting_list_t*>& posting
case 1:
while(its[0].valid()) {
iter_state.ids.push_back(its[0].id());
-
- std::vector<block_t*> block_vec(1);
- std::vector<uint32_t> index_vec(1);
-
iter_state.blocks.push_back(its[0].block());
iter_state.indices.push_back(its[0].index());