Skip to content

perf(hnsw): optimize backlink addition, ranking and pruning - #104

Draft
pranav7002 wants to merge 1 commit into
sdslabs:mainfrom
pranav7002:hnsw-backlink-fast-path
Draft

pranav7002 wants to merge 1 commit into
sdslabs:mainfrom
pranav7002:hnsw-backlink-fast-path

Conversation

@pranav7002

@pranav7002 pranav7002 commented Oct 28, 2026 •

Copy link
Copy Markdown

This is a draft PR where i will do the algorithmic and implementation based optimizations that could be done over backlink addition, ranking, or pruning. Once the PR can be closed, i will add benchmark runs to show the difference, before a merge into main.

Part of #100

@pranav7002 pranav7002 changed the title optimization(hnsw): optimize backlink addition, ranking and pruning perf(hnsw): optimize backlink addition, ranking and pruning Oct 28, 2026
@pranav7002

Copy link
Copy Markdown
Author

Results for using merge_and_prune() only when the number of neighbors already present is already equal to M/M0:

image

The QPS vs Recall stays almost same since this optimisation targeted inserts. Small chnage but each insert is now 9.3% faster than befor. Ill take on some more forward link and back link optimisations in this PR next after discussing, then move on to more complex optimisations.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant