Skip to content

Commit

Permalink
Hold onto allocated buffers more aggressively
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayjshah committed Aug 10, 2021
1 parent 84e69e1 commit 31e39ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func getBuffer() *bytes.Buffer {
}

func putBuffer(buf *bytes.Buffer) {
const max = 4 * 1024 // if >4 KiB, don't hold onto it
const max = 1024 * 1024 // if >1 MiB, don't hold onto it
if buf.Cap() > max {
return
}
Expand Down

0 comments on commit 31e39ac

Please sign in to comment.