-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[chore][processor/deltatocumulative] Optimize exponential histogram m… #37010
base: main
Are you sure you want to change the base?
Conversation
@@ -26,10 +26,10 @@ func Merge(arel, brel Buckets) { | |||
size := up - lo | |||
|
|||
counts := pcommon.NewUInt64Slice() |
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.
[For reviewers] There is also some opportunity to reduce allocations a bit more if arel
is already at the required capacity and the lower bound of the final result is the arel
's lower bound but I haven't done that yet since that might require some discussion over readability vs performance.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
@@ -26,10 +26,10 @@ func Merge(arel, brel Buckets) { | |||
size := up - lo | |||
|
|||
counts := pcommon.NewUInt64Slice() | |||
counts.Append(make([]uint64, size-counts.Len())...) | |||
counts.EnsureCapacity(size) |
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.
How to reduce allocations by this optimization?
Description
Simplifies the merge of exponential histogram a bit and also reduces allocations.
Link to tracking issue
N/A
Testing
N/A
Documentation
N/A