Closed Stebalien closed 4 months ago
bytes.Buffer will often over-allocate. Here, we copy to an exact-sized buffer to avoid this. We'll pay some extra copying cost, but we can at least avoid the allocation overhead with a buffer pool in most cases.
bytes.Buffer
Attention: Patch coverage is 83.33333% with 3 lines in your changes are missing coverage. Please review.
83.33333%
3 lines
Project coverage is 53.32%. Comparing base (f6a28b2) to head (c64ccd1).
f6a28b2
c64ccd1
bytes.Buffer
will often over-allocate. Here, we copy to an exact-sized buffer to avoid this. We'll pay some extra copying cost, but we can at least avoid the allocation overhead with a buffer pool in most cases.