[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: |