prometheus/model/labels
Patrick Oyarzun ae170f644c
Optimize long alternate lists (#463)
* Use a prefix trie for long alternate lists

* Add test for non terminal node

* Fix panic in FuzzFastRegexMatcher_WithFuzzyRegularExpressions when the fuzzy regex is invalid

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Address PR feedback

* Update model/labels/regexp_test.go

Co-authored-by: Marco Pracucci <marco@pracucci.com>

* Replace trie with slice or map depending on input size

* Fix tests

* Pull in tests from @pracucci's branch

* Add setMatches back in

* Use stringMatcher when it's faster

* Fix linter

* Estimate alternates ahead of time

* Simplify construction with `IndexByte`

* Add test and early return for empty regexp.

* Fix race conditions in tests

---------

Signed-off-by: Marco Pracucci <marco@pracucci.com>
Co-authored-by: Marco Pracucci <marco@pracucci.com>
2023-04-01 08:35:35 +02:00
..
labels.go labels: cope with mutating Builder during Range call 2023-03-16 13:28:15 +00:00
labels_string.go labels: cope with mutating Builder during Range call 2023-03-16 13:28:15 +00:00
labels_test.go labels: add test for Builder.Range 2023-03-16 13:25:55 +00:00
matcher.go Optimize long alternate lists (#463) 2023-04-01 08:35:35 +02:00
matcher_test.go Expose Matcher.Prefix() 2023-01-19 17:21:28 +01:00
regexp.go Optimize long alternate lists (#463) 2023-04-01 08:35:35 +02:00
regexp_test.go Optimize long alternate lists (#463) 2023-04-01 08:35:35 +02:00
sharding.go Hardcode the labels stable hash function instead of taking it as an option 2023-01-30 14:21:18 +01:00
test_utils.go labels: use ScratchBuilder in ReadLabels 2022-12-19 15:22:09 +00:00