You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Julie Tibshirani (Jira)" <ji...@apache.org> on 2021/10/02 02:07:00 UTC

[jira] [Commented] (LUCENE-10130) HnswGraph could make use of a SparseFixedBitSet.getAndSet

    [ https://issues.apache.org/jira/browse/LUCENE-10130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17423452#comment-17423452 ] 

Julie Tibshirani commented on LUCENE-10130:
-------------------------------------------

I like the idea of just committing the current patch for now -- it seems like a nice improvement, and as Robert noted it's natural for all BitSet types to have a getAndSet method. I looked over the patch and it looks good to me.

> HnswGraph could make use of a SparseFixedBitSet.getAndSet
> ---------------------------------------------------------
>
>                 Key: LUCENE-10130
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10130
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Robert Muir
>            Priority: Major
>         Attachments: LUCENE-10130.patch
>
>
> Currently HnswGraph uses SparseFixedBitSet "visited" to track where it has already been. The logic currently looks like this:
> {code}
> if (visited.get(entryPoint) == false) {
>   visited.set(entryPoint);
>   ... logic ...
> }
> {code}
> If SparseFixedBitSet had a {{getAndSet}} (like FixedBitSet), the code could be:
> {code}
> if (visited.getAndSet(entrypoint) == false) {
>   ... logic ...
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org