Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-16138 [C++] Improve performance of ExecuteScalarExpression
  3. ARROW-16562

[C++] Avoid slicing array inputs in ExecBatchIterator that would result in one slice

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • C++

    Description

      For scalar functions, ExecBatchIterator is used to iterate over batches in smaller units. It is implemented by calling Array::slice(). For small batches, this is unecessary, since only one slice is created. The slice operation still causes some overhead by copying the shrared_ptrs of the ArrayData object, inclung the type pointer, which can lead to contention (ARROW-16161).

      This Patch checks if the batch size is smaller than the slice size first, and uses std::move in this case.

      I have attached a comparision of the ExecuteScalarExpressionOverhead benchmark here: avoid-slicing-performance.txt 

      (created with --benchmark_min_time=20, the standard low runtime tends to be noisy with this, but also shows a positive tendency)

      Attachments

        1. avoid-slicing-performance.txt
          7 kB
          Tobias Zagorni

        Issue Links

          Activity

            People

              zagto Tobias Zagorni
              zagto Tobias Zagorni
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 1h 10m
                  1h 10m