perf: optimise right for byte access and StringView #20069
+350
−47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
rightfor byte access and StringView #20068.Rationale for this change
Similar to issue #19749 and the optimisation of
leftin #19980, it's worth doing the same forrightWhat changes are included in this PR?
Improve efficiency of the function by making fewer memory allocations and going directly to bytes, based on char boundaries
Provide a specialisation for StringView with buffer zero-copy
Use
arrow_array::buffer::make_viewfor low-level view manipulation (we still need to know about a magic constant 12 for a buffer layout)Benchmark - up to 90% performance improvement
Are these changes tested?
Existing unit tests for
rightAdded more unit tests
Added bench similar to
right.rsExisting SLTs pass
Are there any user-facing changes?
No