mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
app/vmselect/promql: reduce memory allocations at getCommonLabelFilters() function
Intern tag keys and values there
This commit is contained in:
parent
e2498af530
commit
7067e8206c
1 changed files with 3 additions and 1 deletions
|
@ -508,7 +508,9 @@ func getCommonLabelFilters(tss []*timeseries) []metricsql.LabelFilter {
|
||||||
m := make(map[string][]string)
|
m := make(map[string][]string)
|
||||||
for _, ts := range tss {
|
for _, ts := range tss {
|
||||||
for _, tag := range ts.MetricName.Tags {
|
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))
|
lfs := make([]metricsql.LabelFilter, 0, len(m))
|
||||||
|
|
Loading…
Reference in a new issue