JasonLi-cn opened a new pull request, #9971:
URL: https://github.com/apache/arrow-datafusion/pull/9971

   ## 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. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   Closes https://github.com/apache/arrow-datafusion/issues/9970
   
   ## Rationale for this change
   
   When converting case, there is no need to transform each value individually. 
Instead, you can treat the data in the StringArray as a single value and then 
perform the case conversion on it. Benefits include:
   
   - Avoiding iteration.
   - Directly allocating a contiguous block of memory, thereby avoiding the 
overhead of repeatedly allocating memory when creating a StringArray through an 
Iterator.
   
   ### Benchmark
   
   #### Lower
   
   ```shell
   Gnuplot not found, using plotters backend
   lower                   time:   [4.1643 µs 4.1685 µs 4.1734 µs]
                           change: [-84.240% -84.203% -84.168%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 10 outliers among 100 measurements (10.00%)
     7 (7.00%) high mild
     3 (3.00%) high severe
   
   lower #2                time:   [16.691 µs 16.717 µs 16.749 µs]
                           change: [-84.176% -84.139% -84.103%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 11 outliers among 100 measurements (11.00%)
     3 (3.00%) high mild
     8 (8.00%) high severe
   
   lower #3                time:   [32.922 µs 32.952 µs 32.988 µs]
                           change: [-84.964% -84.923% -84.879%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 8 outliers among 100 measurements (8.00%)
     3 (3.00%) high mild
     5 (5.00%) high severe
   ```
   
   #### Upper
   
   ```shell
   Gnuplot not found, using plotters backend
   upper                   time:   [4.1681 µs 4.1766 µs 4.1875 µs]
                           change: [-84.387% -84.320% -84.259%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 12 outliers among 100 measurements (12.00%)
     4 (4.00%) high mild
     8 (8.00%) high severe
   
   upper #2                time:   [16.721 µs 16.746 µs 16.775 µs]
                           change: [-84.457% -84.377% -84.303%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 6 outliers among 100 measurements (6.00%)
     2 (2.00%) high mild
     4 (4.00%) high severe
   
   upper #3                time:   [32.929 µs 32.963 µs 33.006 µs]
                           change: [-85.216% -85.155% -85.098%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 12 outliers among 100 measurements (12.00%)
     6 (6.00%) high mild
     6 (6.00%) high severe
   ```
   
   
   ## What changes are included in this PR?
   
   <!--
   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?
   
   <!--
   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?
   
   <!--
   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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to