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

Reduce buffer copying in RawBsonDocumentCodec#decode

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.0
    • Affects Version/s: 3.0.0
    • Component/s: Codecs, Performance
    • None

      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.

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

              Created:
              Updated:
              Resolved: