diff options
Diffstat (limited to 'internal/io/pool/bytesbuffer.go')
| -rw-r--r-- | internal/io/pool/bytesbuffer.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/io/pool/bytesbuffer.go b/internal/io/pool/bytesbuffer.go index 3d48f2c..21871f1 100644 --- a/internal/io/pool/bytesbuffer.go +++ b/internal/io/pool/bytesbuffer.go @@ -10,7 +10,9 @@ import ( var BytesBuffer = sync.Pool{ New: func() interface{} { b := bytes.Buffer{} - b.Grow(128) + // Increase initial capacity to 4KB to reduce reallocations + // Most log lines are between 100-500 bytes, but some can be larger + b.Grow(4096) return &b }, } |
