You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Rich-T-kid (via GitHub)" <gi...@apache.org> on 2026/04/28 20:49:06 UTC
[PR] REE row conversion speed up [arrow-rs]
Rich-T-kid opened a new pull request, #9845:
URL: https://github.com/apache/arrow-rs/pull/9845
# Which issue does this PR close?
this PR closes #7693
<!--
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.
-->
# Rationale for this change
Previously in https://github.com/apache/arrow-rs/pull/7649 within **run::encode()**, **encode_one()** was called repeatedly even in cases where the **row.row()** bytes didn't change in between calls.
<!--
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?
I added benchmarks to show the improvement between the two approaches. In my implementation, **encode_one()** is called once per run, if the run length is greater than one, the encoded bytes are copied into the remaining output slots and the offsets are updated in a tight loop. This removes the nested while loop and its per-iteration overhead, leaving only a memcpy which is unavoidable.
<!--
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?
yes, thankfully @brancz added extensive test in his PR, i also wrote a test do debug some things but it mostly covered behavior that his test caught so I didn't include it in this PR
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
# Are there any user-facing changes?
no
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
If there are any breaking changes to public APIs, please call them out.
-->
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] REE row conversion speed up [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9845:
URL: https://github.com/apache/arrow-rs/pull/9845#issuecomment-4347353501
Thanks @Jefffrey and @brancz
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] REE row conversion speed up [arrow-rs]
Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on PR #9845:
URL: https://github.com/apache/arrow-rs/pull/9845#issuecomment-4338954175
### Post optimization
<img width="1378" height="644" alt="Image 4-28-26 at 4 39 PM" src="https://github.com/user-attachments/assets/bdde7b46-3967-4baa-b476-0e0e472223f4" />
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] REE row conversion speed up [arrow-rs]
Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on PR #9845:
URL: https://github.com/apache/arrow-rs/pull/9845#issuecomment-4338969929
@alamb pretty small PR with a pretty small performance boost but it should close the ticket. I initially just tried your approach of hoisting the call to row.Row() outside the loop but it showed very slim/regressed performance. Im guessing it was because copying the byte pointer was just as slow/slower as calling row.Row() repeatedly which I found pretty suprising.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] REE row conversion speed up [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #9845:
URL: https://github.com/apache/arrow-rs/pull/9845
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] REE row conversion speed up [arrow-rs]
Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on PR #9845:
URL: https://github.com/apache/arrow-rs/pull/9845#issuecomment-4338952378
### Pre-optimization
<img width="1532" height="756" alt="Image 4-28-26 at 3 27 PM" src="https://github.com/user-attachments/assets/9727549a-738e-4805-88a3-66ea6ca7cdf5" />
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org