mirror of https://github.com/grafana/loki
Improve wal entries encoding. (#3153)
Little trick to avoid memory allocation with regards to bytes slice and string. benchmp: ``` ❯ benchcmp before.txt after.txt benchmark old ns/op new ns/op delta Benchmark_EncodeEntries-16 1699362 1055627 -37.88% benchmark old allocs new allocs delta Benchmark_EncodeEntries-16 20025 25 -99.88% benchmark old bytes new bytes delta Benchmark_EncodeEntries-16 5625393 4665376 -17.07% ``` This originated from an investigation on CPU usage of ingester. Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>pull/3156/head
parent
cfbc5f84e6
commit
2a90c4ceb5
Loading…
Reference in new issue