simonvandel opened a new pull request, #12890:
URL: https://github.com/apache/datafusion/pull/12890
## 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.
-->
Didn't create an issue beforehand.
## Rationale for this change
<!--
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.
-->
Same idea as https://github.com/apache/datafusion/pull/12881. Using the
`unary` functions allow faster processing (most likely auto-vectorized code) by
avoiding branching on nulls.
## 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.
-->
- Add bench
- Apply `unary`
## 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)?
-->
Yes, with existing tests.
## Are there any user-facing changes?
Yes, faster `signum`:
```
signum f32 array: 1024 time: [419.68 ns 420.68 ns 421.84 ns]
change: [-93.679% -93.655% -93.628%] (p = 0.00 <
0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) high mild
4 (4.00%) high severe
signum f64 array: 1024 time: [1.1809 µs 1.1822 µs 1.1835 µs]
change: [-81.672% -81.630% -81.593%] (p = 0.00 <
0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
4 (4.00%) high mild
1 (1.00%) high severe
signum f32 array: 4096 time: [1.1124 µs 1.1137 µs 1.1153 µs]
change: [-96.060% -96.049% -96.039%] (p = 0.00 <
0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
6 (6.00%) high mild
2 (2.00%) high severe
signum f64 array: 4096 time: [5.4527 µs 5.4624 µs 5.4725 µs]
change: [-80.223% -80.176% -80.125%] (p = 0.00 <
0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild
signum f32 array: 8192 time: [2.2937 µs 2.2959 µs 2.2983 µs]
change: [-96.218% -96.199% -96.181%] (p = 0.00 <
0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
signum f64 array: 8192 time: [15.455 µs 15.534 µs 15.630 µs]
change: [-75.051% -74.722% -74.440%] (p = 0.00 <
0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
4 (4.00%) high mild
1 (1.00%) high severe
```
<!--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]