mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/promql/aggr_incremental.go: eliminate unnecessary memory allocation in incrementalAggrFuncContext.updateTimeseries
This commit is contained in:
parent
953b96ced2
commit
b7cc1af3eb
1 changed files with 3 additions and 3 deletions
|
@ -111,8 +111,8 @@ func (iafc *incrementalAggrFuncContext) updateTimeseries(tsOrig *timeseries, wor
|
||||||
removeGroupTags(&ts.MetricName, &iafc.ae.Modifier)
|
removeGroupTags(&ts.MetricName, &iafc.ae.Modifier)
|
||||||
bb := bbPool.Get()
|
bb := bbPool.Get()
|
||||||
bb.B = marshalMetricNameSorted(bb.B[:0], &ts.MetricName)
|
bb.B = marshalMetricNameSorted(bb.B[:0], &ts.MetricName)
|
||||||
k := string(bb.B)
|
k := bb.B
|
||||||
iac := m[k]
|
iac := m[string(k)]
|
||||||
if iac == nil {
|
if iac == nil {
|
||||||
if iafc.ae.Limit > 0 && len(m) >= iafc.ae.Limit {
|
if iafc.ae.Limit > 0 && len(m) >= iafc.ae.Limit {
|
||||||
// Skip this time series, since the limit on the number of output time series has been already reached.
|
// Skip this time series, since the limit on the number of output time series has been already reached.
|
||||||
|
@ -131,7 +131,7 @@ func (iafc *incrementalAggrFuncContext) updateTimeseries(tsOrig *timeseries, wor
|
||||||
ts: tsAggr,
|
ts: tsAggr,
|
||||||
values: make([]float64, len(ts.Values)),
|
values: make([]float64, len(ts.Values)),
|
||||||
}
|
}
|
||||||
m[k] = iac
|
m[string(k)] = iac
|
||||||
}
|
}
|
||||||
bbPool.Put(bb)
|
bbPool.Put(bb)
|
||||||
iafc.callbacks.updateAggrFunc(iac, ts.Values)
|
iafc.callbacks.updateAggrFunc(iac, ts.Values)
|
||||||
|
|
Loading…
Reference in a new issue