lib/bytesutil/internstring.go: increase the limit on the maximum string lengths, which can be interned

The limit has been increased from 300 bytes to 500 bytes according to the collected production stats.
This allows reducing CPU usage without significant increase of RAM usage in most practical cases.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3692
This commit is contained in:
Aliaksandr Valialkin 2023-01-31 10:55:31 -08:00
parent d93ac2b1ea
commit a522bbc8b4
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

@ -9,7 +9,7 @@ import (
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
var internStringMaxLen = flag.Int("internStringMaxLen", 300, "The maximum length for strings to intern. Lower limit may save memory at the cost of higher CPU usage. "+
var internStringMaxLen = flag.Int("internStringMaxLen", 500, "The maximum length for strings to intern. Lower limit may save memory at the cost of higher CPU usage. "+
"See https://en.wikipedia.org/wiki/String_interning")
// InternBytes interns b as a string