VictoriaMetrics/lib/promrelabel
Roman Khavronenko fae589bb83
lib/promrelabel: speedup label match by __name__ (#6432)
The change adds a fastpath for `equalValue` comparisons against
`__name__` label by avoiding calls to `toCanonicalLabelName` func. This
speedups matches by metric name like `'foo'`. See bench stats below:
```
benchcmp old.txt new.txt

benchmark                                           old ns/op     new ns/op     delta
BenchmarkIfExpression/equal_label:_last-10          35.6          35.1          -1.18%
BenchmarkIfExpression/equal_label:_middle-10        18.3          17.3          -5.41%
BenchmarkIfExpression/equal_label:_first-10         1.20          1.24          +2.74%
BenchmarkIfExpression/equal___name__:_last-10       10.1          4.96          -50.75%
BenchmarkIfExpression/equal___name__:_middle-10     5.79          3.16          -45.41%
BenchmarkIfExpression/equal___name__:_first-10      1.17          1.05          -9.76%
```

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2024-06-07 16:35:52 +02:00
..
testdata
config_test.go all: fix golangci-lint(revive) warnings after 0c0ed61ce7 2024-04-03 03:00:45 +03:00
config.go lib/logstorage: work-in-progress 2024-05-24 03:07:07 +02:00
debug.go all: consistently use %w instead of %s in when error is passed to fmt.Errorf() 2023-10-26 09:44:40 +02:00
debug.qtpl all: replace old https://docs.victoriametrics.com/relabeling.html url with the new one - https://docs.victoriametrics.com/relabeling/ 2024-04-18 03:23:15 +02:00
debug.qtpl.go all: replace old https://docs.victoriametrics.com/relabeling.html url with the new one - https://docs.victoriametrics.com/relabeling/ 2024-04-18 03:23:15 +02:00
graphite_test.go
graphite_timing_test.go
graphite.go
if_expression_test.go lib/promrelabel: add support for a list of series selectors at IfExpression 2023-07-24 17:09:59 -07:00
if_expression_timing_test.go lib/promrelabel: speedup label match by __name__ (#6432) 2024-06-07 16:35:52 +02:00
if_expression.go lib/promrelabel: speedup label match by __name__ (#6432) 2024-06-07 16:35:52 +02:00
relabel_test.go all: fix golangci-lint(revive) warnings after 0c0ed61ce7 2024-04-03 03:00:45 +03:00
relabel_timing_test.go lib/promrelabel: properly replace : char with _ in metric names when -usePromCompatibleNaming command-line flag is set 2023-08-14 16:18:17 +02:00
relabel.go lib/protoparser/opentelemetry: follow-up after 47892b4a4c 2024-04-03 03:09:52 +03:00
scrape_url_test.go lib/promrelabel: make target url from labels on target relabel page (#3882) 2023-03-20 22:08:39 -07:00
scrape_url.go lib/promrelabel: make target url from labels on target relabel page (#3882) 2023-03-20 22:08:39 -07:00