zhaih opened a new issue, #12236: URL: https://github.com/apache/lucene/issues/12236
### Description In #12050 we added ability to reuse old graph as an initializer to speed up the merge, but even when we are re-inserting the old graph's node, we still need to calculate a similarity score [here](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java#L205) so that we can pop-out the worst non-diverse node [here](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java#L393) based on a sorted sequence. But since the score is only used for diversity checking purpose, we probably do not even need them in some cases (like when we never reach the level connection limit). So we probably can first insert those nodes without calculating the score, then when we eventually need to pop a worst node, we can calculate the score, sort the neighbor array and then do the normal "find the worst node" procedure. -- 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-unsubscr...@lucene.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org