Skip to content
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

Reduce object allocations of CompensatedSum in aggregations #49506

Closed
talevy opened this issue Nov 22, 2019 · 1 comment · Fixed by #49548
Closed

Reduce object allocations of CompensatedSum in aggregations #49506

talevy opened this issue Nov 22, 2019 · 1 comment · Fixed by #49548
Assignees

Comments

@talevy
Copy link
Contributor

talevy commented Nov 22, 2019

#48558 introduced a CompensatedSum helper class to reduce duplicate code in aggregations that computed kahan summations for things like centroid, and average calculations. It definitely consolidated this code, but also resulted in multiple creations of these objects that can be avoided.

Possible solution:

A lot of the use-cases of CompensatedSum work off values from DoubleArrays, so maybe it is worth exploring a dedicated DoubleArray that has the kahan-summation logic baked into it. That way the calculation can be consolidated and in-line with no object allocations.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (:Analytics/Aggregations)

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

Successfully merging a pull request may close this issue.

3 participants