neilconway opened a new pull request, #21535:
URL: https://github.com/apache/datafusion/pull/21535
## Which issue does this PR close?
- Closes #21534.
## Rationale for this change
Optimize `||` for `Utf8View` values in two ways:
1. We previously checked two `Option`s for every row, to check for NULL
values. It is faster to precompute the NULL bitmap and then just check a single
bitmap. Annoyingly, `StringViewBuilder` still requires constructing the result
NULL bitmap itself incrementally, but fixing that would be a more invasive
change.
2. We previously constructed the result value with `write!({l}, {r})`, which
goes through the `fmt` machinery and is very slow. It is more efficient to just
`write_str` twice.
Benchmarks (Arm64):
```
- concat_utf8view/concat/nulls_0: 289.9µs → 140.2µs (-51.6%)
- concat_utf8view/concat/nulls_10: 293.5µs → 154.7µs (-47.3%)
- concat_utf8view/concat/nulls_50: 197.9µs → 95.0µs (-52.0%)
```
## What changes are included in this PR?
* Add benchmark for string concatenation
* Implement optimizations described above
## Are these changes tested?
Yes.
## 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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]