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

CompoundFileReader's openInput produces streams that may do an extra buffer copy

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.3
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Spinoff of LUCENE-888.

      The class for reading from a compound file (CompoundFileReader) has a
      primary stream which is a BufferedIndexInput when that stream is from
      an FSDirectory (which is the norm). That is one layer of buffering.

      Then, when its openInput is called, a CSIndexInput is created which
      also subclasses from BufferedIndexInput. That's a second layer of
      buffering.

      When a consumer actually uses that CSIndexInput to read, and a call to
      readByte or readBytes runs out of what's in the first buffer, it will
      go to refill its buffer. But that refill calls the first
      BufferedIndexInput which in turn may refill its buffer (a double
      copy) by reading the underlying stream.

      Not sure how to fix it yet but we should change things to not do the
      extra buffer copy.

        Attachments

        1. LUCENE-892.patch
          4 kB
          Michael McCandless

          Activity

            People

            • Assignee:
              mikemccand Michael McCandless
              Reporter:
              mikemccand Michael McCandless
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: