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

MQE: add support for unless #9533

Merged
merged 6 commits into from
Oct 7, 2024
Merged

MQE: add support for unless #9533

merged 6 commits into from
Oct 7, 2024

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Oct 7, 2024

What this PR does

This PR adds support for the unless binary operation, building on the support for and added in #9507.

Compared to Prometheus' engine, latency is up to 60% lower and peak memory consumption is up to 48% lower in our benchmarks:

                                                                          │  Prometheus   │               Mimir                │
                                                                          │    sec/op     │   sec/op     vs base               │
Query/a_1_unless_b_1{l=~'.*[0-4]$'},_instant_query-10                        721.4µ ± 12%   716.4µ ± 1%        ~ (p=0.093 n=6)
Query/a_1_unless_b_1{l=~'.*[0-4]$'},_range_query_with_100_steps-10           777.4µ ±  4%   745.8µ ± 6%        ~ (p=0.180 n=6)
Query/a_1_unless_b_1{l=~'.*[0-4]$'},_range_query_with_1000_steps-10          1.310m ±  3%   1.184m ± 3%   -9.67% (p=0.002 n=6)
Query/a_100_unless_b_100{l=~'.*[0-4]$'},_instant_query-10                    1.635m ±  2%   1.631m ± 2%        ~ (p=0.937 n=6)
Query/a_100_unless_b_100{l=~'.*[0-4]$'},_range_query_with_100_steps-10       3.266m ±  1%   2.343m ± 1%  -28.27% (p=0.002 n=6)
Query/a_100_unless_b_100{l=~'.*[0-4]$'},_range_query_with_1000_steps-10     17.681m ±  1%   8.731m ± 2%  -50.62% (p=0.002 n=6)
Query/a_2000_unless_b_2000{l=~'.*[0-4]$'},_instant_query-10                  17.30m ±  2%   17.06m ± 1%   -1.39% (p=0.041 n=6)
Query/a_2000_unless_b_2000{l=~'.*[0-4]$'},_range_query_with_100_steps-10     52.37m ±  1%   30.90m ± 1%  -41.01% (p=0.002 n=6)
Query/a_2000_unless_b_2000{l=~'.*[0-4]$'},_range_query_with_1000_steps-10    402.6m ±  5%   146.5m ± 1%  -63.61% (p=0.002 n=6)

                                                                          │  Prometheus   │                Mimir                │
                                                                          │       B       │      B        vs base               │
Query/a_1_unless_b_1{l=~'.*[0-4]$'},_instant_query-10                        70.76Mi ± 3%   68.78Mi ± 2%   -2.79% (p=0.041 n=6)
Query/a_1_unless_b_1{l=~'.*[0-4]$'},_range_query_with_100_steps-10           69.18Mi ± 2%   68.72Mi ± 3%        ~ (p=0.225 n=6)
Query/a_1_unless_b_1{l=~'.*[0-4]$'},_range_query_with_1000_steps-10          67.70Mi ± 3%   66.66Mi ± 2%        ~ (p=0.065 n=6)
Query/a_100_unless_b_100{l=~'.*[0-4]$'},_instant_query-10                    66.35Mi ± 1%   66.12Mi ± 2%        ~ (p=0.329 n=6)
Query/a_100_unless_b_100{l=~'.*[0-4]$'},_range_query_with_100_steps-10       66.99Mi ± 1%   66.29Mi ± 2%   -1.05% (p=0.026 n=6)
Query/a_100_unless_b_100{l=~'.*[0-4]$'},_range_query_with_1000_steps-10      72.31Mi ± 2%   67.63Mi ± 1%   -6.47% (p=0.002 n=6)
Query/a_2000_unless_b_2000{l=~'.*[0-4]$'},_instant_query-10                  68.11Mi ± 2%   69.30Mi ± 2%        ~ (p=0.065 n=6)
Query/a_2000_unless_b_2000{l=~'.*[0-4]$'},_range_query_with_100_steps-10     83.55Mi ± 2%   73.02Mi ± 2%  -12.61% (p=0.002 n=6)
Query/a_2000_unless_b_2000{l=~'.*[0-4]$'},_range_query_with_1000_steps-10    198.3Mi ± 1%   104.1Mi ± 3%  -47.50% (p=0.002 n=6)

Which issue(s) this PR fixes or relates to

(none)

Checklist

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

@charleskorn charleskorn marked this pull request as ready for review October 7, 2024 03:54
@charleskorn charleskorn requested a review from a team as a code owner October 7, 2024 03:54
Copy link
Contributor

@jhesketh jhesketh left a comment

Choose a reason for hiding this comment

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

Nice stuff!

@charleskorn charleskorn merged commit e69a4c5 into main Oct 7, 2024
29 checks passed
@charleskorn charleskorn deleted the charleskorn/mqe-unless branch October 7, 2024 06:17
@jhesketh jhesketh mentioned this pull request Dec 2, 2024
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.

2 participants