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

use slice() api in packedints decode

    XMLWordPrintableJSON

    Details

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

      Description

      Today, for example 8-bpv decoder looks like this:

      in.seek(startPointer + index);
      return in.readByte() & 0xFF;
      

      If instead we take a slice of 'in', we can remove an addition. Its not much, but helps a little. additionally we already (in PackedInts.java) compute the number of bytes, so we could make this an actual slice of the range, which would return an error on abuse instead of garbage data.

        Attachments

        1. LUCENE-5728.patch
          10 kB
          Robert Muir

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: