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

   ## 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 #.
   
   ## Rationale for this change
   Eliminate the intermediate `Vec<char>` and directly push into a `String`.
   <!--
    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.  
   -->
   
   ## What changes are included in this PR?
   Update the `initcap` function, benchmark included.
   <!--
   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?
   Yes, existing unit tests.
   <!--
   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?
   No.
   <!--
   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.
   -->
   *BENCHMARK RESULT
   ```rust
   Compiling datafusion-functions v43.0.0 
(/home/tailm/repos/github/datafusion/datafusion/functions)
       Finished `bench` profile [optimized] target(s) in 1m 02s
        Running benches/initcap.rs 
(target/release/deps/initcap-408d405a24fbbea1)
   Gnuplot not found, using plotters backend
   initcap string view shorter than 12 [size=1024]
                           time:   [34.326 µs 34.353 µs 34.383 µs]
                           change: [-48.954% -48.796% -48.631%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 26 outliers among 100 measurements (26.00%)
     4 (4.00%) low severe
     9 (9.00%) low mild
     5 (5.00%) high mild
     8 (8.00%) high severe
   
   initcap string view longer than 12 [size=1024]
                           time:   [52.105 µs 52.151 µs 52.201 µs]
                           change: [-54.232% -54.111% -53.998%] (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
   
   initcap string [size=1024]
                           time:   [53.143 µs 53.324 µs 53.587 µs]
                           change: [-53.164% -52.956% -52.775%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 7 outliers among 100 measurements (7.00%)
     5 (5.00%) high mild
     2 (2.00%) high severe
   
   initcap string view shorter than 12 [size=4096]
                           time:   [135.91 µs 136.08 µs 136.27 µs]
                           change: [-51.523% -51.418% -51.301%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 14 outliers among 100 measurements (14.00%)
     6 (6.00%) high mild
     8 (8.00%) high severe
   
   initcap string view longer than 12 [size=4096]
                           time:   [202.91 µs 203.35 µs 204.06 µs]
                           change: [-53.743% -53.636% -53.540%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 11 outliers among 100 measurements (11.00%)
     7 (7.00%) high mild
     4 (4.00%) high severe
   
   initcap string [size=4096]
                           time:   [205.59 µs 205.78 µs 206.00 µs]
                           change: [-53.462% -53.306% -53.164%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 11 outliers among 100 measurements (11.00%)
     5 (5.00%) high mild
     6 (6.00%) high severe
   ```


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

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


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

Reply via email to