Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2075

Reduce buffer copying in RawBsonDocumentCodec#decode

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.3.0
    • 3.0.0
    • Codecs, Performance
    • None

    Description

      Currently, this method creates two copies of the BSON byte array, one in a BasicOutputBuffer, and a second in an UnsafeByteArrayOutputStream. Since this method owns the BasicOutputBuffer instance, we could safely take the byte array (along with an offset and length) directly from the BasicOutputBuffer and transfer ownership to the RawBsonDocument.

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: