Add benchmark for native histograms#13160
Merged
bboreham merged 3 commits intoprometheus:mainfrom Nov 23, 2023
Merged
Conversation
bboreham
approved these changes
Nov 21, 2023
promql/bench_test.go
Outdated
| return err | ||
| } | ||
| } | ||
| if _, err := app.AppendHistogram(0, labels.FromStrings(lbls...), ts, histograms[i], nil); err != nil { |
Member
There was a problem hiding this comment.
Calling FromStrings repeatedly could be expensive.
I see there are similar things in other tests and can't point at an obviously better example.
There's this, but really it ought to re-use the Builder.
Contributor
Author
There was a problem hiding this comment.
Makes sense. I've extracted the call to labels.FromStrings at the top of the loop. We still call it once per series, but at least it's not once per sample.
e1f979e to
0dbb3de
Compare
Member
|
Lint issue should be fixed now if you rebase. |
This commit adds a PromQL benchmark for queries on native histograms. Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
bfb48a5 to
792b824
Compare
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.
This commit adds a PromQL benchmark for queries on native histograms.