[JAVA-2075] Reduce buffer copying in RawBsonDocumentCodec#decode Created: 06/Jan/16  Updated: 19/Oct/16  Resolved: 15/Jun/16

Status: Closed
Project: Java Driver
Component/s: Codecs, Performance
Affects Version/s: 3.0.0
Fix Version/s: 3.3.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.



 Comments   
Comment by Githook User [ 15/Jun/16 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-2075: Reduce buffer copying for RawBsonDocument decoding
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/bd34e4f02b46002af59048a3f382b2ad33d94ec0

Generated at Thu Feb 08 08:56:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.