Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
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.
Attachments
Issue Links
- links to