jhorstmann opened a new pull request, #9217:
URL: https://github.com/apache/arrow-rs/pull/9217

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax.
   -->
   
   - Closes #9216.
   
   # Rationale for this change
   
   Profiling showed this loop to be a clear performance hotspot and thanks to 
the new `BooleanBufferBuilder::extend_trusted_len` method introduced in #9137 
there is a very simple improvement.
   
   Benchmark results for optional structs after the fix:
   
   ```
   arrow_array_reader/struct/Int32Array/plain encoded, optional struct, 
optional data, no NULLs
                           time:   [69.873 µs 69.917 µs 69.970 µs]
                           change: [−60.075% −60.046% −60.018%] (p = 0.00 < 
0.05)
                           Performance has improved.
   arrow_array_reader/struct/Int32Array/plain encoded, optional struct, 
optional data, half NULLs
                           time:   [136.62 µs 136.66 µs 136.72 µs]
                           change: [−67.663% −67.536% −67.416%] (p = 0.00 < 
0.05)
                           Performance has improved.
   ```
   
   This is a big improvement, but still significantly slower than reading 
non-nested data. The main hotspot still is the `extend_trusted_len` and manual 
simd code for comparing chunks and appending 64-bits at a time could 
potentially speed it up even more. But that would require either architecture 
specific intrinsics or unstable features.
   
   <!--
   Why are you proposing this change? If this is already explained clearly in 
the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your 
changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is 
sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are these changes tested?
   
   Tested by existing tests.
   
   # Are there any user-facing changes?
   
   no


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to