From 65e70326b86c4127a3bac39698ec5cc0e914f150 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 6 Oct 2023 14:07:35 -0700 Subject: [PATCH] Updated comment [skip ci] --- src/hnswutils.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hnswutils.c b/src/hnswutils.c index b7a388c..bbb9120 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -1058,8 +1058,12 @@ HnswInsertElement(HnswElement element, HnswElement entryPoint, Relation index, F else lw = w; - /* Candidates are sorted, but set sortCandidates to true */ - /* for in-memory builds to enable closer caching */ + /* + * Candidates are sorted, but not deterministically. Set + * sortCandidates to true for in-memory builds to enable closer + * caching. Could alternatively skip caching here, but there does not + * seem to be a difference in performance either way. + */ neighbors = SelectNeighbors(lw, lm, lc, procinfo, collation, element, NULL, NULL, index == NULL); AddConnections(element, neighbors, lm, lc);