Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-10130

HnswGraph could make use of a SparseFixedBitSet.getAndSet

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.0
    • None
    • New

    Description

      Currently HnswGraph uses SparseFixedBitSet "visited" to track where it has already been. The logic currently looks like this:

      if (visited.get(entryPoint) == false) {
        visited.set(entryPoint);
        ... logic ...
      }
      

      If SparseFixedBitSet had a getAndSet (like FixedBitSet), the code could be:

      if (visited.getAndSet(entrypoint) == false) {
        ... logic ...
      }
      

      Attachments

        1. LUCENE-10130_round2.patch
          3 kB
          Robert Muir
        2. LUCENE-10130.patch
          8 kB
          Robert Muir

        Activity

          People

            Unassigned Unassigned
            rcmuir Robert Muir
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: