You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2026/07/21 15:01:02 UTC

[PR] perf: optimize left_right in datafusion-functions [datafusion]

andygrove opened a new pull request, #23762:
URL: https://github.com/apache/datafusion/pull/23762

   > This PR was created by an LLM as a draft PR. I will mark it as ready for review after human review.
   
   
   ## Which issue does this PR close?
   
   N/A — autonomous exploratory PR.
   
   ## Rationale for this change
   
   Added an ASCII fast path to left_right_byte_length so left/right compute the n-th codepoint byte offset via O(1) arithmetic instead of a per-row char_indices() UTF-8 scan.
   
   ## What changes are included in this PR?
   
   Added an ASCII fast path to left_right_byte_length so left/right compute the n-th codepoint byte offset via O(1) arithmetic instead of a per-row char_indices() UTF-8 scan.
   
   ## Are these changes tested?
   
   Correctness: unit tests + seeded differential fuzz (bit-identical Arrow output vs `main`).
   
   Benchmark (criterion):
   
   - string_view short_result: 4.848% faster (base 56784ns -> cand 54031ns)
   - string long_result: 38.098% faster (base 141926ns -> cand 87855ns)
   - string_view long_result: 44.817% faster (base 94346ns -> cand 52063ns)
   - string short_result: 13.184% faster (base 88532ns -> cand 76860ns)
   - string_view short_result: 15.165% faster (base 57136ns -> cand 48472ns)
   - string long_result: 39.278% faster (base 140969ns -> cand 85600ns)
   - string_view long_result: 40.29% faster (base 81808ns -> cand 48847ns)
   - string short_result: 14.369% faster (base 86809ns -> cand 74336ns)
   
   Full criterion output:
   
   ```text
   left/string short_result
                           time:   [73.406 µs 73.726 µs 74.067 µs]
                           change: [−15.026% −14.369% −13.742%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 1 outliers among 100 measurements (1.00%)
     1 (1.00%) low mild
   left/string long_result time:   [85.227 µs 85.519 µs 85.827 µs]
                           change: [−39.588% −39.278% −38.969%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 3 outliers among 100 measurements (3.00%)
     1 (1.00%) low mild
     2 (2.00%) high mild
   left/string_view short_result
                           time:   [48.206 µs 48.411 µs 48.613 µs]
                           change: [−17.549% −15.165% −13.033%] (p = 0.00 < 0.05)
                           Performance has improved.
   left/string_view long_result
                           time:   [48.383 µs 48.691 µs 49.038 µs]
                           change: [−40.884% −40.290% −39.714%] (p = 0.00 < 0.05)
                           Performance has improved.
   
   right/string short_result
                           time:   [76.804 µs 76.986 µs 77.159 µs]
                           change: [−13.955% −13.184% −12.465%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 6 outliers among 100 measurements (6.00%)
     3 (3.00%) low severe
     3 (3.00%) low mild
   right/string long_result
                           time:   [88.219 µs 88.597 µs 88.938 µs]
                           change: [−38.351% −38.098% −37.853%] (p = 0.00 < 0.05)
                           Performance has improved.
   right/string_view short_result
                           time:   [53.380 µs 53.545 µs 53.728 µs]
                           change: [−5.5061% −4.8482% −4.1872%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 3 outliers among 100 measurements (3.00%)
     3 (3.00%) high mild
   right/string_view long_result
                           time:   [52.049 µs 52.332 µs 52.633 µs]
                           change: [−45.883% −44.817% −43.850%] (p = 0.00 < 0.05)
                           Performance has improved.
   Found 6 outliers among 100 measurements (6.00%)
     6 (6.00%) high mild
   ```
   
   
   ## Are there any user-facing changes?
   
   <!--
   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 add the `api change` label.
   -->
   


-- 
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@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] perf: optimize left_right in datafusion-functions [datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead merged PR #23762:
URL: https://github.com/apache/datafusion/pull/23762


-- 
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@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] perf: optimize left_right in datafusion-functions [datafusion]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #23762:
URL: https://github.com/apache/datafusion/pull/23762#issuecomment-5035902101

   ## [Codecov](https://app.codecov.io/gh/apache/datafusion/pull/23762?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 80.71%. Comparing base ([`050046a`](https://app.codecov.io/gh/apache/datafusion/commit/050046a7f0c08d64d8dba9ebf0e3544cbda6cd38?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e7f98fa`](https://app.codecov.io/gh/apache/datafusion/commit/e7f98fa18e30b8db244c24520267bfe3b1732b1a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main   #23762      +/-   ##
   ==========================================
   - Coverage   80.71%   80.71%   -0.01%     
   ==========================================
     Files        1089     1089              
     Lines      368750   368753       +3     
     Branches   368750   368753       +3     
   ==========================================
   - Hits       297631   297626       -5     
   - Misses      53375    53380       +5     
   - Partials    17744    17747       +3     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion/pull/23762?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org