Open
Conversation
Contributor
Author
|
Benchmarks: |
3c0885c to
2daa41d
Compare
We previously ran the `scalar` benchmarks for different array sizes, despite the scalar benchmark code being invariant to array size. Add a variant where we run `initcap` for different string lengths.
2daa41d to
5ccd135
Compare
We already had an ASCII-only branch; we might as well take advantage of it to iterate over bytes directly, which significantly increases performance.
5ccd135 to
0e07b48
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Rationale for this change
When all values in a
Utf8/LargeUtf8array are ASCII, we can skip usingGenericStringBuilderand instead process the entire input buffer in a single pass using byte-level operations. This also avoids recomputing the offsets and nulls arrays. A similar optimization is already used for lower() and upper().Along the way, optimize
initcap_string()for ASCII-only inputs. It already had an ASCII-only fastpath but there was room for further optimization, by iterating over bytes rather than characters.What changes are included in this PR?
Are these changes tested?
Yes, plus an additional test added.
Are there any user-facing changes?
No.