Avoid unnecessary conversions between model.Metric and labels.Labels by damnever · Pull Request #6710 · cortexproject/cortex · GitHub
Skip to content

Avoid unnecessary conversions between model.Metric and labels.Labels#6710

Merged
danielblando merged 2 commits into
cortexproject:masterfrom
damnever:perf/lessc
Apr 24, 2025
Merged

Avoid unnecessary conversions between model.Metric and labels.Labels#6710
danielblando merged 2 commits into
cortexproject:masterfrom
damnever:perf/lessc

Conversation

@damnever

Copy link
Copy Markdown
Contributor

What this PR does:

Remove complex conversions when selecting only series: LabelAdapters -> model.Metric(map) -> labels.Labels.

Which issue(s) this PR fixes:
Fixes #

Checklist

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

Signed-off-by: Xiaochao Dong (@damnever) <the.xcdong@gmail.com>

@yeya24 yeya24 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a great change. Have you tried to benchmark it and see how much it helps?

Comment thread pkg/cortexpb/signature.go Outdated
Signed-off-by: Xiaochao Dong (@damnever) <the.xcdong@gmail.com>
@damnever

Copy link
Copy Markdown
Contributor Author

@damnever

Copy link
Copy Markdown
Contributor Author

@danielblando danielblando left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants