Skip to content

Commit

Permalink
speed up
Browse files Browse the repository at this point in the history
  • Loading branch information
kisasexypantera94 committed Apr 21, 2024
1 parent 6462fcb commit 9589afe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ std::vector<HashSet<size_t>> InMemoryGraph<T>::BuildIndexInBatches(size_t s_idx)

n_out[b_idx] = RobustPrune(b_idx, candidates, alpha);
}

prev_n_out[b_idx] = n_out[b_idx];
}
});

for (size_t p_idx = start; p_idx <= end; ++p_idx) {
prev_n_out[p_idx] = n_out[p_idx];
}

for (const auto& [b_idx, _]: affected_points) {
prev_n_out[b_idx] = n_out[b_idx];
}
tbb::parallel_for(tbb::blocked_range<size_t>(start, end + 1), [&](tbb::blocked_range<size_t> r) {
for (size_t p_idx = r.begin(); p_idx < r.end(); ++p_idx) {
prev_n_out[p_idx] = n_out[p_idx];
}
});

ksp::log::Info("Processed batch: range=[{}..{}], precision=[{}]",
start,
Expand Down

0 comments on commit 9589afe

Please sign in to comment.