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

[Rust] Slow BufferBuilder<BooleanType> inserts within PrimitiveBuilder::append_slice

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 1.0.0
    • Rust

    Description

      BufferBuilder<BooleanType>::append_slice is called by PrimitiveBuilder::append_slice with a constructed vector of true values.

      Even in release builds the associated allocations and iterations are not optimised out, resulting in a third of the time to parse a parquet file containing single integers being spent in PrimitiveBuilder::append_slice.

      This PR adds an append_n method to the BufferBuilderTrait that allows this to be handled more efficiently. My rather unscientific testing shows it to halve the amount of time spent in this method yielding an ~20% speedup for my particular workload.

       

      Attachments

        Issue Links

          Activity

            People

              tustvold Raphael Taylor-Davies
              tustvold Raphael Taylor-Davies
              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 - 2h 40m
                  2h 40m