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

[C++][Compute] Optimize variance kernel for integers #26295

Closed
asfimport opened this issue Oct 14, 2020 · 2 comments
Closed

[C++][Compute] Optimize variance kernel for integers #26295

asfimport opened this issue Oct 14, 2020 · 2 comments

Comments

@asfimport
Copy link

Current variance kernel converts all data type to double before calculation. It's sub-optimal for integers. Integer arithmetic is much faster than floating points, e.g., summation is 4x faster [1].

A quick test for calculating int32 variance shows up to 3x performance gain. Another benefit is that integer arithmetic is accurate.

[1] https://quick-bench.com/q/_Sz-Peq1MNWYwZYrTtQDx3GI7lQ

Reporter: Yibo Cai / @cyb70289
Assignee: Yibo Cai / @cyb70289

PRs and other links:

Note: This issue was originally created as ARROW-10304. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Antoine Pitrou / @pitrou:
For the record, the slowdown seems mostly due to int->double conversion. That doesn't change the overall result, though :-)

@asfimport
Copy link
Author

Antoine Pitrou / @pitrou:
Issue resolved by pull request 8466
#8466

@asfimport asfimport added this to the 3.0.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants