Skip to content

Commit 8c6960b

Browse files
committed
fix a performance degradation.
(To check that there is a preprocessor flag has_deletions which allows avoiding executing the code for deletes when there are none. )
1 parent c2bc2ad commit 8c6960b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hnswlib/hnswalg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ namespace hnswlib {
271271

272272
std::pair<dist_t, tableint> current_node_pair = candidate_set.top();
273273

274-
if ((-current_node_pair.first) > lowerBound && top_candidates.size() == ef) {
274+
if ((-current_node_pair.first) > lowerBound && (top_candidates.size() == ef || has_deletions == false)) {
275275
break;
276276
}
277277
candidate_set.pop();

0 commit comments

Comments
 (0)