Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-5910

Reduce copying of data when reading mmapped records

    XMLWordPrintableJSON

    Details

      Description

      The idea is to reduce the amount of extra byte buffers created when reading mmapped records, if possible pushing the ByteBuffer all the way to the consumer.
      For example reading a String from a Segment right now means first reading the bytes of of the record into a byte array, then creating a string with an encoding (which behind the scenes will copy the byte array again and run it through the decoder). An alternative is to call decode on the Charset and pass in the ByteBuffer, skipping the intermediate operations.

      There are a few cases of this I included in the patch, but there may be others (like the SegmentStream which needs a full rewrite).

      Interested in what others think of this!

        Attachments

        1. OAK-5910.patch
          10 kB
          Alex Deparvu

          Activity

            People

            • Assignee:
              stillalex Alex Deparvu
              Reporter:
              stillalex Alex Deparvu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: