You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "rajat315315 (via GitHub)" <gi...@apache.org> on 2026/07/01 14:32:16 UTC
[I] Improve sorting logic in NeighborArray [lucene]
rajat315315 opened a new issue, #16321:
URL: https://github.com/apache/lucene/issues/16321
### Description
The legacy sorting logic in NeighborArray below takes long N^2 in worst case, as it is a simple insertion sort and pushes/copies the rest of the array towards the end for each `uncheckedIndex`.
https://github.com/apache/lucene/blob/d87b4f3881511092bb2a5ec7530e7418157c16fc/lucene/core/src/java/org/apache/lucene/util/hnsw/NeighborArray.java#L152
I think it has a lot of scope for improvement and I'm attaching a PR below and opening a discussion for same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org