Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-8129

[C++][Compute] Refine compare sorting kernel

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.17.0
    • C++

    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

          Activity

            People

              yibocai Yibo Cai
              yibocai Yibo Cai
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m