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

   ## Which issue does this PR close?
   
   N/A
   
   ## Rationale for this change
   
   It is wasteful to allocate temporary memory with intermediate `to_string` 
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.  
   -->
   
   ```
   chr                     time:   [3.7600 µs 3.7730 µs 3.7892 µs]
                           change: [-74.908% -74.553% -74.265%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 12 outliers among 100 measurements (12.00%)
     2 (2.00%) low mild
     2 (2.00%) high mild
     8 (8.00%) high severe
   ```
   
   ## What changes are included in this PR?
   
   - Add a bench for `chr`
   - Avoid intermediate String allocations by encoding directly to the string 
array
   
   ## 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)?
   -->
   
   Relying on 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.
   -->
   
   Faster execution


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to