Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hnswalg.h #324

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update hnswalg.h
Collect_metrics@searchBaseLayer  : We should not increment metric_distance_computation with the size of neighbors, since there may be some neighbors already visited.
  • Loading branch information
zeraph6 authored Jul 9, 2021
commit 63be3c524578f69419fd79c091a1919e7c4f00e2
8 changes: 4 additions & 4 deletions hnswlib/hnswalg.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,9 @@ namespace hnswlib {
int *data = (int *) get_linklist0(current_node_id);
size_t size = getListCount((linklistsizeint*)data);
// bool cur_node_deleted = isMarkedDeleted(current_node_id);
if(collect_metrics){
if(collect_metrics)
metric_hops++;
metric_distance_computations+=size;
}


#ifdef USE_SSE
_mm_prefetch((char *) (visited_array + *(data + 1)), _MM_HINT_T0);
Expand All @@ -301,7 +300,8 @@ namespace hnswlib {
_MM_HINT_T0);////////////
#endif
if (!(visited_array[candidate_id] == visited_array_tag)) {

if(collect_metrics)metric_distance_computations++;

visited_array[candidate_id] = visited_array_tag;

char *currObj1 = (getDataByInternalId(candidate_id));
Expand Down