-
Notifications
You must be signed in to change notification settings - Fork 840
Optimize mergeStream #1485
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
Optimize mergeStream #1485
Conversation
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
|
suggests this comment wasn't true? |
bboreham
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like some more information on why the repeated code cannot be a function, before approving.
|
Ah yup, then I guess the improvement was by efficient use of Also avoiding |
I will club repeated code into functions and see if there is any difference in perf. If Go is inlining them, I believe there shouldn't be much difference. |
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
|
This comment that was there before: Can this comment be relied on? Seems the code would be a lot simpler if it were. |
|
I considered that, but here are the reasons why I infer
|
|
At least, the comment should be changed. |
|
I will try to simplify and add more comments to make it more readable.
I was thinking we can remove |
After some changes at some other places, this code suddenly started taking a lot of allocs (upto 7x) and B/op (and also time) for query involving a lot of chunks. Reusing the buffer solves it. Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
|
I have simplified some part of |
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
tomwilkie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're had this running for ~2 weeks now, no problems observed.
In my quest of optimizing query performance, I found that
result.appendwas taking a significant amount of time inmergeStream(2s+ of around 4s ofmergeStream).The query and data in action is described here prometheus/prometheus#5707 (comment)
In this PR I have inlined the appending logic with the merging logic. This saves anywhere from
1s-2.5sfor the above data.