neilconway opened a new pull request, #11251:
URL: https://github.com/apache/arrow-rs/pull/11251

   # Which issue does this PR close?
   
   - N/A
   
   # Rationale for this change
   
   Casting boolean to a string type previously went through the generic 
`ArrayFormatter` code. We can do better because we know that all booleans 
result in one of two strings ("true" or "false").
   
   Benchmarks: (M4 Max)
   
   - Utf8, no nulls: 96.651 → 58.339 µs — 1.66× faster.
   - Utf8, ~20% nulls: 92.293 → 36.162 µs — 2.55× faster.
   - Utf8View, no nulls: 108.194 → 56.666 µs — 1.91× faster.
   - Utf8View, ~20% nulls: 108.703 → 47.403 µs — 2.29× faster.
   
   # What changes are included in this PR?
   
   * Introduce `cast_bool_to_string` and call it from the cast dispatch logic
   * Add benchmarks
   * Revise/extend unit tests
   
   # Are these changes tested?
   
   Yes; existing tests pass, new tests added. We don't need 
string-type-specific tests anymore.
   
   # Are there any user-facing changes?
   
   No.
   


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