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

   # 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.
   -->
   
   - Spawn off from #9653 
   - Contributes to #9731
   
   # Rationale for this change
   
   <!--
   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.
   -->
   
   See #9731
   
   # What changes are included in this PR?
   
   Add `is_accumulating_rle()` and `extend_run()` methods to `RleEncoder` that 
allow callers to detect when the encoder is in RLE accumulation mode and 
bulk-extend runs without per-element overhead.
   
   Upgrade `put_with_observer()` in `LevelEncoder` to exploit this: after each 
`put()`, it checks whether the encoder entered accumulation mode. If so, it 
scans ahead for the rest of the run, calls `extend_run()` to batch it in O(1), 
and fires the observer once with the full run length.
   
   This turns the previous O(n) per-value encoding + observation into O(1) 
amortized per RLE run, which is a significant improvement for sparse columns 
where long runs of identical levels are common.
   
   # Are these changes tested?
   
   All test passing + added coverage around RLE accumu;ation mode trigger.
   
   # Are there any user-facing changes?
   
   None.


-- 
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