diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 3f999f677822..25a6b617a637 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -71,9 +71,8 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Upgraded apache arrow library used in x-pack/libbeat/reader/parquet from v11 to v12.0.1 in order to fix cross-compilation issues {pull}35640[35640] - Fix panic when MaxRetryInterval is specified, but RetryInterval is not {pull}35820[35820] - Do not print context cancelled error message when running under agent {pull}36006[36006] - - - Fix recovering from invalid output configuration when running under Elastic-Agent {pull}36016[36016] +- Improve StreamBuf append to improve performance when reading long lines from files. {pull}35928[35928] *Auditbeat* diff --git a/libbeat/common/streambuf/streambuf.go b/libbeat/common/streambuf/streambuf.go index f28c21577920..48bbabae0d5f 100644 --- a/libbeat/common/streambuf/streambuf.go +++ b/libbeat/common/streambuf/streambuf.go @@ -155,7 +155,9 @@ func (b *Buffer) doAppend(data []byte, retainable bool, newCap int) error { b.data = tmp } } - b.data = append(b.data, data...) + tBuf := bytes.NewBuffer(b.data) + tBuf.Write(data) + b.data = tBuf.Bytes() } b.available += len(data)