mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/promql: pre-allocate memory for values to be merged in mergeTimeseries()
This should reduce the number of memory re-allocations
This commit is contained in:
parent
645c24dc5f
commit
30ed33fae0
1 changed files with 1 additions and 0 deletions
|
@ -525,6 +525,7 @@ func mergeTimeseries(a, b []*timeseries, bStart int64, ec *EvalConfig) []*timese
|
||||||
var tmp timeseries
|
var tmp timeseries
|
||||||
tmp.denyReuse = true
|
tmp.denyReuse = true
|
||||||
tmp.Timestamps = sharedTimestamps
|
tmp.Timestamps = sharedTimestamps
|
||||||
|
tmp.Values = make([]float64, 0, len(tmp.Timestamps))
|
||||||
tmp.MetricName.MoveFrom(&tsA.MetricName)
|
tmp.MetricName.MoveFrom(&tsA.MetricName)
|
||||||
tmp.Values = append(tmp.Values, tsA.Values...)
|
tmp.Values = append(tmp.Values, tsA.Values...)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue