VictoriaMetrics/lib/bytesutil
Aliaksandr Valialkin 3b18931050
lib/bytesutil: cache results for all the input strings, which were passed during the last 5 minutes from FastStringMatcher.Match(), FastStringTransformer.Transform() and InternString()
Previously only up to 100K results were cached.
This could result in sub-optimal performance when more than 100K unique strings were actually used.
For example, when the relabeling rule was applied to a million of unique Graphite metric names
like in the https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3466

This commit should reduce the long-term CPU usage for https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3466
after all the unique Graphite metrics are registered in the FastStringMatcher.Transform() cache.

It is expected that the number of unique strings, which are passed to FastStringMatcher.Match(),
FastStringTransformer.Transform() and to InternString() during the last 5 minutes,
is limited, so the function results fit memory. Otherwise OOM crash can occur.
This should be the case for typical production workloads.
2022-12-12 14:41:13 -08:00
..
bytebuffer.go lib/bytesutil: split Resize* funcs to MayOverallocate and NoOverallocate for more fine-grained control over memory allocations 2022-02-01 00:18:42 +02:00
bytebuffer_test.go all: rename ReadAt* to MustReadAt* in order to dont clash with io.ReaderAt 2020-01-30 15:08:58 +02:00
bytesutil.go all: readability improvements for query traces 2022-06-30 18:20:33 +03:00
bytesutil_test.go lib/bytesutil: split Resize* funcs to MayOverallocate and NoOverallocate for more fine-grained control over memory allocations 2022-02-01 00:18:42 +02:00
fast_string_matcher.go lib/bytesutil: cache results for all the input strings, which were passed during the last 5 minutes from FastStringMatcher.Match(), FastStringTransformer.Transform() and InternString() 2022-12-12 14:41:13 -08:00
fast_string_matcher_test.go lib/regexutil: cache MatchString results for unoptimized regexps 2022-09-30 10:41:29 +03:00
fast_string_matcher_timing_test.go lib/regexutil: cache MatchString results for unoptimized regexps 2022-09-30 10:41:29 +03:00
fast_string_transformer.go lib/bytesutil: cache results for all the input strings, which were passed during the last 5 minutes from FastStringMatcher.Match(), FastStringTransformer.Transform() and InternString() 2022-12-12 14:41:13 -08:00
fast_string_transformer_test.go lib/bytesutil: add FastStringTransformer and use it in the rest of the code where needed 2022-09-28 10:41:00 +03:00
fast_string_transformer_timing_test.go lib/regexutil: cache MatchString results for unoptimized regexps 2022-09-30 10:41:29 +03:00
internstring.go lib/bytesutil: cache results for all the input strings, which were passed during the last 5 minutes from FastStringMatcher.Match(), FastStringTransformer.Transform() and InternString() 2022-12-12 14:41:13 -08:00
internstring_test.go lib/bytesutil: move InternString() from lib/promscrape/discoverytutils to lib/bytesutil 2022-09-30 07:44:35 +03:00
internstring_timing_test.go lib/bytesutil: move InternString() from lib/promscrape/discoverytutils to lib/bytesutil 2022-09-30 07:44:35 +03:00
itoa.go lib/promscrape: optimize service discovery speed 2022-11-29 21:26:00 -08:00
itoa_test.go lib/promscrape: optimize service discovery speed 2022-11-29 21:26:00 -08:00