viliam-durina commented on PR #14016:
URL: https://github.com/apache/lucene/pull/14016#issuecomment-2510926970

   Our use case is to speed-up indexing of larger segments. We want to build 
fewer segments, so it makes sense to build them on multiple cores. We build the 
segments directly, not building smaller segments first, and then merging.
   
   The `HnswGraphSearcher` is used internally when building the graph. When the 
graph is built concurrently, you need to copy the `neighborArray` while holding 
the lock, which is implemented in a private inner class within 
`HnswConcurrentMergeBuilder`. This PR moves that inner implementation to 
`HnswGraphBuilder` - this way the locking logic is better encapsulated there - 
if a lock is given, it will use the concurrent searcher using the lock. If 
there's no lock, it will use the unsynchronized version.
   
   I understand this PR is for a non-standard use of the API and you might not 
care, and that the current structure works for your case. But I think the new 
structure is more logical anyway.


-- 
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

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

Reply via email to