You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorting kernel implements two comparison functions, CompareValues use array.Value() for numeric data and CompareViews uses array.GetView() for non-numeric ones. It can be simplified by using GetView() only as all data types support GetView().
To my surprise, benchmark shows about 40% performance improvement after the change.
After some digging, I find in current code, the comparison callback is not inlined (check disassembled code), it leads to a function call. It's very bad for this hot loop. Using only GetView() fixes this issue, code inlined okay.
Another 10% performance improvement is observed after applying your change. The only problem is binary/string types don't have raw_values() member function.
Disassembled code shows the difference (may be not very accurate as it's hard to locate the original code after compiler optimization)
Sorting kernel implements two comparison functions, CompareValues use array.Value() for numeric data and CompareViews uses array.GetView() for non-numeric ones. It can be simplified by using GetView() only as all data types support GetView().
To my surprise, benchmark shows about 40% performance improvement after the change.
After some digging, I find in current code, the comparison callback is not inlined (check disassembled code), it leads to a function call. It's very bad for this hot loop. Using only GetView() fixes this issue, code inlined okay.
Reporter: Yibo Cai / @cyb70289
Assignee: Yibo Cai / @cyb70289
PRs and other links:
Note: This issue was originally created as ARROW-8129. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: