[JAVA-2636] Improve the performance of ByteBufPayloadBsonDocument Created: 12/Oct/17 Updated: 29/Oct/23 Resolved: 13/Nov/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Monitoring |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Ross Lawley | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Epic Link: | Java MongoDB 3.6 Support |
| Comments |
| Comment by Githook User [ 13/Nov/17 ] | ||||||||||||||||||
|
Author: {'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}Message: Take advantage of the observation that a command with a payload is likely to be small (minus the payload) | ||||||||||||||||||
| Comment by Githook User [ 13/Nov/17 ] | ||||||||||||||||||
|
Author: {'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}Message: | ||||||||||||||||||
| Comment by Jeffrey Yemin [ 12/Oct/17 ] | ||||||||||||||||||
|
Since we know that the commands that have payloads are the three write commands, and that those commands are quite small (minus the payload itself), we can afford to hydrate the command document into an actual BsonDocument, then add the payload as a BsonArray. This is similar to what's done in InsertProtocol#getAsWriteCommand. As a method of CommandMessage it would look something like this:
|