-
Notifications
You must be signed in to change notification settings - Fork 284
perf: refactor sum int with specialized implementations for each eval_mode #3054
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3054 +/- ##
============================================
+ Coverage 56.12% 59.99% +3.86%
- Complexity 976 1475 +499
============================================
Files 119 175 +56
Lines 11743 16165 +4422
Branches 2251 2681 +430
============================================
+ Hits 6591 9698 +3107
- Misses 4012 5114 +1102
- Partials 1140 1353 +213 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderfender could you review? |
coderfender
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.
Reviewed the individual accumulators and code LGTM . I will continue to review grups accumulator and provide an update soon
coderfender
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.
LGTM
|
@comphead could you review when you have time |
|
This approach creates a lot of code duplication, the difference being mostly in overflow handling. How about we have a trait say, OverflowStrategy, and then implementations of the overflow strategy for each eval mode. Then the implementation can just use the appropriate implementation while most of the code remains the same. |
If I understand correctly, you're suggesting a common implementation that invokes a dyn trait per row for overflow handling? |
|
minor : I wonder if we could reuse |
Good point. I also considered a macro based approach but that just makes the code very unreadable. I guess this approach should be okay. |
Which issue does this PR close?
Closes #.
Rationale for this change
The current implementation of accumulators for
sum_inthandle all three eval modes, making the code complex to understand and also adds overhead due to matching on eval mode within loops.What changes are included in this PR?
Refactored
sum_int.rsfrom a single accumulator with eval mode branches inside loops into 6 separate accumulator implementations:Single-row accumulators:
Groups accumulators:
Key changes:
How are these changes tested?
Existing tests.
Benchmark results show some improvement for group accumulators but not for row accumulators.