[GODRIVER-2021] Operation.createMsgWireMessage() allocates memory inefficiently Created: 23/May/21 Updated: 28/Oct/23 Resolved: 08/Sep/22 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | 1.5.2 |
| Fix Version/s: | 1.11.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Tim Fogarty | Assignee: | Qingyang Hu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | Reduce Allocations | ||||||||
| Quarter: | FY23Q2, FY23Q3 | ||||||||
| Description |
|
This loop in Operation.createMsgWireMessage() is inefficient:
since dst is not at the required cap before the loop, it causes multiple allocations and the final cap of dst can be up to 2x larger than needed. Calculating the total length of batches in op.Batches.Current and resizing dst before the loop would be more efficient.
|
| Comments |
| Comment by Githook User [ 07/Sep/22 ] |
|
Author: {'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}Message: |