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

Speed up MMapDirectory.seek()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.9, 6.0
    • core/store
    • None
    • New

    Description

      For traditional lucene access which is mostly sequential, occasional advance(), I think this method gets drowned out in noise.

      But for access like docvalues, its important. Unfortunately seek() is complex today because of mapping multiple buffers.

      However, the very common case is that only one map is used for a given clone or slice.

      When there is the possibility to use only a single mapped buffer, we should instead take advantage of ByteBuffer.slice(), which will adjust the internal mmap address and remove the offset calculation. furthermore we don't need the shift/mask or even the negative check, as they are then all handled with the ByteBuffer api: seek is a one-liner (with try/catch of course to convert exceptions).

      This makes docvalues access 20% faster, I havent tested conjunctions or anyhting like that.

      Attachments

        1. LUCENE-5722.patch
          12 kB
          Robert Muir
        2. LUCENE-5722.patch
          18 kB
          Uwe Schindler
        3. LUCENE-5722.patch
          19 kB
          Uwe Schindler
        4. LUCENE-5722.patch
          20 kB
          Uwe Schindler
        5. LUCENE-5722-multiseek.patch
          2 kB
          Uwe Schindler
        6. LUCENE-5722.patch
          19 kB
          Uwe Schindler
        7. LUCENE-5722.patch
          21 kB
          Uwe Schindler

        Activity

          People

            uschindler Uwe Schindler
            rcmuir Robert Muir
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: