mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +00: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
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue