Skip to content

Commit

Permalink
reuse buf size 512
Browse files Browse the repository at this point in the history
  • Loading branch information
harley.li committed Jul 5, 2021
1 parent 08b037b commit 91610ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (e *Encoder) Clean() {
// it reuse allocated buffer and reduce memory-allocation.
func (e *Encoder) ReuseBufferClean() {
var buffer []byte
if cap(e.buffer) <= 128 {
if cap(e.buffer) <= 512 {
// reuse buffer, avoid allocate
buffer = e.buffer[:0]
} else {
Expand Down

0 comments on commit 91610ac

Please sign in to comment.