Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make active series benchmark more realistic, improve performance of context cancellation check. #7396

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

flxbk
Copy link
Contributor

@flxbk flxbk commented Feb 15, 2024

What this PR does

This makes the responses used in BenchmarkActiveSeriesMiddlewareMergeResponses more realistic.
Using the altered benchmark, it improves performance of the context cancellation check performed in mergeResponses.

pkg: github.com/grafana/mimir/pkg/frontend/querymiddleware
                                                                             │   main      │              branch               │
                                                                             │   sec/op    │   sec/op     vs base              │
ActiveSeriesMiddlewareMergeResponses/seriesCount=10_000/num-responses-4-10     19.05m ± 9%   19.14m ± 1%       ~ (p=0.818 n=6)
ActiveSeriesMiddlewareMergeResponses/seriesCount=10_000/num-responses-16-10    90.16m ± 2%   86.81m ± 2%  -3.72% (p=0.002 n=6)
ActiveSeriesMiddlewareMergeResponses/seriesCount=10_000/num-responses-64-10    422.4m ± 4%   401.8m ± 6%  -4.88% (p=0.002 n=6)
ActiveSeriesMiddlewareMergeResponses/seriesCount=10_000/num-responses-128-10   924.7m ± 3%   849.8m ± 6%  -8.10% (p=0.004 n=6)
geomean                                                                        160.9m        154.3m       -4.10%

Which issue(s) this PR fixes or relates to

Fixes #

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@flxbk flxbk marked this pull request as ready for review February 15, 2024 17:08
@flxbk flxbk requested a review from a team as a code owner February 15, 2024 17:08
@flxbk flxbk force-pushed the felix/active-series-context-cancellation branch from 234adbf to feddbe6 Compare February 15, 2024 17:13
Copy link
Contributor

@ortuman ortuman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! thanks! 👍

@flxbk flxbk merged commit a52ab84 into main Feb 16, 2024
28 checks passed
@flxbk flxbk deleted the felix/active-series-context-cancellation branch February 16, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants