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

Speed up BufferedIndexInput.randomAccessSlice

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.9, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Today this uses the default implementation, e.g. for readInt(pos):

      @Override
      public int readInt(long pos) throws IOException {
        slice.seek(pos);
        return slice.readInt();
      }
      

      But this causes the bounds to be checked twice. Just like we did for MMap, we can provide a faster implementation that only checks once: yields ~30% speedup.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: