mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
app/vmselect/promql: reduce memory allocations at getCommonLabelFilters() function
Intern tag keys and values there
This commit is contained in:
parent
a819e30ddf
commit
d33a65e401
@ -525,7 +525,9 @@ func getCommonLabelFilters(tss []*timeseries) []metricsql.LabelFilter {
|
||||
m := make(map[string][]string)
|
||||
for _, ts := range tss {
|
||||
for _, tag := range ts.MetricName.Tags {
|
||||
m[string(tag.Key)] = append(m[string(tag.Key)], string(tag.Value))
|
||||
k := bytesutil.InternBytes(tag.Key)
|
||||
v := bytesutil.InternBytes(tag.Value)
|
||||
m[k] = append(m[k], v)
|
||||
}
|
||||
}
|
||||
lfs := make([]metricsql.LabelFilter, 0, len(m))
|
||||
|
Loading…
Reference in New Issue
Block a user