Skip to content

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Oct 23, 2024

What this PR does

This PR is a small optimisation for instant vector selectors in MQE.

Previously, instant vector selectors would always use a slice with capacity for the number of steps in the range query.

However, if a series only has samples beginning part-way through the query range, this is wasteful: we know the series can't have more samples than remain in the query range, so we don't need such a big slice.

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 23, 2024 02:59
@charleskorn charleskorn requested a review from a team as a code owner October 23, 2024 02:59
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 find. This could be a decent amount for somebody querying over a year for a newly spawned metric.

@charleskorn charleskorn merged commit 9370c58 into main Oct 23, 2024
29 checks passed
@charleskorn charleskorn deleted the charleskorn/mqe-slice-sizing branch October 23, 2024 04:03
@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