grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
22.71k stars 3.3k forks source link

chore: Optimize line_tokenizer for better performance #13305

Open cyriltovena opened 6 days ago

cyriltovena commented 6 days ago

The line_tokenizer code has been optimized to improve performance. The make function for the tokens slice has been modified to use a capacity of 64 instead of the length of the line.

Hopefully this helps keep allocation under control.

What this PR does / why we need it:

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Checklist