-
Notifications
You must be signed in to change notification settings - Fork 812
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
Implement histogram iterators for batch #5944
Implement histogram iterators for batch #5944
Conversation
Signed-off-by: Ben Ye <[email protected]>
Signed-off-by: Ben Ye <[email protected]>
Timestamps [BatchSize]int64 | ||
Values [BatchSize]float64 | ||
Histograms [BatchSize]*histogram.Histogram | ||
FloatHistograms [BatchSize]*histogram.FloatHistogram |
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.
Any idea how I can change to make Batch smaller? It should be only 1 value type per batch and other array are redundant.
// The batch reached it intended size or a new value type is used. | ||
// Add another batch to the result and use it for further appending. |
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.
Is it possible to change the value type?
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.
Each batch will only have one value type.
Amazing. LGTM |
Benchmark results on current implementation compared with the old code. Old version seems having much better CPU time probably since the logic is simpler. No need to check different chunk value types. It is hard to tell if CPU increase is relevant to the two additional arrays in batch type. Old version has better allocation, too, which is expected. Although the change is small.
|
My plan is to combine the two histogram arrays into one and use unsafe pointer to store them together. I will implement that and run the benchmark again. |
Implemented the unsafe version. It is still worse than the version without support native histograms. But it is better than the version with two histogram arrays. I am going to switch to use the unsafe version.
|
Signed-off-by: Ben Ye <[email protected]>
Signed-off-by: Ben Ye <[email protected]>
Signed-off-by: Ben Ye <[email protected]>
Discussed with @alanprot and we think it is better to use the original version without unsafe pointer. We can optimize this code when needed. |
What this PR does:
Support native histogram chunks in batch iterator. This should unlock native histogram support in Querier.
Since we haven't added support to ingest native histograms yet, I will try to add querying native histograms of Querier in another PR.
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]