test(loki.process): Add benchmarks to test performance with a large number of stage.match components - #6879
Open
csmarchbanks wants to merge 1 commit into
Open
test(loki.process): Add benchmarks to test performance with a large number of stage.match components#6879csmarchbanks wants to merge 1 commit into
csmarchbanks wants to merge 1 commit into
Conversation
…ages Adaptive-logs style configurations can compile down to a loki.process pipeline with hundreds of stage.match rules, and each stage hands entries off through its own unbuffered channel and goroutine. These benchmarks make that per-stage handoff cost measurable, for a single stream (BenchmarkPipelineManyRules), for one rule among many needing its own channel (BenchmarkPipelineOneMultilineAmongManyRules), and for many concurrent streams competing for the same cores (BenchmarkPipelineManyStreamsSaturated). Assisted-by: Claude Sonnet 5
This was referenced Aug 13, 2026
csmarchbanks
marked this pull request as ready for review
August 13, 2026 15:05
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief description of Pull Request
Adds three benchmarks to
internal/component/loki/process/stages/pipeline_test.go, with no production code changes:BenchmarkPipelineManyRules— per-entry latency for a single stream through a pipeline built from a sweep ofstage.matchrule counts (1 to 1000).BenchmarkPipelineOneMultilineAmongManyRules— the same, with onestage.multilinerule mixed in at different positions among 1000 otherwise-uniform rules.BenchmarkPipelineManyStreamsSaturated— aggregate throughput (entries/sec) across many concurrent streams competing for the same cores, which is where the current one-goroutine-and-channel-per-stage cost shows up most under real load.Pull Request Details
We are trying to move adaptive logs into the client and ran into performance issues when there are lots of
stage.matchentries. This adds benchmarks for those cases so we can improve the performance.Notes to the Reviewer
This is the shared baseline that #6873 and #6875 (and a further change) each build on: every commit that follows on top of this one reports its own before/after
benchstatcomparison against this commit specifically.PR Checklist