[GODRIVER-57] Utilize byte buffer pools to eliminate allocations for wire protocol messages Created: 07/Aug/17  Updated: 27/Oct/23  Resolved: 04/Feb/19

Status: Closed
Project: Go Driver
Component/s: Wire Protocol
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Craig Wilson Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Buffer Pooling

 Description   

Currently, every wire protocol message allocates byte arrays. We should utilize a buffer pool in order to reduce the number of allocations at the expense of keeping around memory.



 Comments   
Comment by Ian Whalen (Inactive) [ 04/Feb/19 ]

Will be incorporated into the driver library redesign.

kris.brandow to make sure that ends up in the design.

Comment by Jeffrey Yemin [ 18/May/18 ]

A cache would increase the memory input with the (possible) benefit of decreasing GC overhead.

I think we should do this ticket after GODRIVER-112 so we have a baseline to compare against, as well as a something we can profile with tools that report on GC overhead.

Comment by Sam Kleinman (Inactive) [ 18/May/18 ]

While this seems bad, are there reports that the allocation (or gc) overhead is actually causing issues or impacting memory footprint? Are there any tests.

Would it make sense to schedule a ticket for writing some benchmarks ahead of this.

On the other hand, using a sync.Pool instance for *bytes.Buffer instances is straight forward and easy, but wouldn't be indexed by size, which might obviate most of the benefit.

(cc jeff.yemin)

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