prometheus/promql
Bryan Boreham 8b863c42dd
Optimise relabeling by re-using memory (#11147)
* model/relabel: Add benchmark

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* model/relabel: re-use Builder across relabels

Saves memory allocations.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* labels.Builder: allow re-use of result slice

This reduces memory allocations where the caller has a suitable slice available.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* model/relabel: re-use source values slice

To reduce memory allocations.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Unwind one change causing test failures

Restore original behaviour in PopulateLabels, where we must not overwrite the input set.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* relabel: simplify values optimisation

Use a stack-based array for up to 16 source labels, which will be the
vast majority of cases.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* lint

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2022-08-19 15:27:52 +05:30
..
fuzz-data
parser Allow setting custom lookback delta for instant queries (#9946) 2022-08-02 11:15:39 +02:00
testdata Adds day_of_year function to PromQL 2022-05-20 14:08:34 +02:00
bench_test.go Track and report Samples Queried per query 2022-03-21 23:49:17 +01:00
engine.go Optimise relabeling by re-using memory (#11147) 2022-08-19 15:27:52 +05:30
engine_test.go Allow setting custom lookback delta for instant queries (#9946) 2022-08-02 11:15:39 +02:00
functions.go Optimise relabeling by re-using memory (#11147) 2022-08-19 15:27:52 +05:30
functions_test.go Avoid literal integer overflows in 32 bit arches. 2022-03-29 22:51:20 +02:00
fuzz.go refactor (promql): move from github.com/pkg/errors to 'errors' and 'fmt' (#10817) 2022-06-08 10:47:52 +02:00
fuzz_test.go error for invalid media type should not be completely swallowed (#10186) 2022-02-08 10:57:56 +01:00
promql_test.go add doc 2022-02-13 21:59:03 +08:00
quantile.go address comment 2022-02-15 22:09:17 +08:00
query_logger.go Close file descriptor in query logging (#11148) 2022-08-17 15:27:27 +05:30
query_logger_test.go refactor: move from io/ioutil to io and os packages (#10528) 2022-04-27 11:24:36 +02:00
test.go refactor (promql): move from github.com/pkg/errors to 'errors' and 'fmt' (#10817) 2022-06-08 10:47:52 +02:00
test_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
value.go Shortcut `ContainsSameLabelset()` (#11000) 2022-07-13 15:18:10 +05:30
value_test.go Shortcut `ContainsSameLabelset()` (#11000) 2022-07-13 15:18:10 +05:30