From 49c5e7afe1c698218a3ee779ac4b74591a061c05 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Sun, 22 Oct 2023 12:38:23 +0000 Subject: [PATCH] PromQL: reduce garbage in range-query evaluation The temporary variable was allocated on the heap, and it is unnecessary. Signed-off-by: Bryan Boreham --- promql/engine.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/promql/engine.go b/promql/engine.go index 4e0769f99..75bceaa16 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -1172,9 +1172,7 @@ func (ev *evaluator) rangeEval(prepSeries func(labels.Labels, *EvalSeriesHelper) bufHelpers[i] = make([]EvalSeriesHelper, len(matrixes[i])) for si, series := range matrixes[i] { - h := seriesHelpers[i][si] - prepSeries(series.Metric, &h) - seriesHelpers[i][si] = h + prepSeries(series.Metric, &seriesHelpers[i][si]) } } }