JasonLi-cn opened a new pull request, #10054: URL: https://github.com/apache/arrow-datafusion/pull/10054
## 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 https://github.com/apache/arrow-datafusion/issues/10053 ## Rationale for this change ### Benchmark #### `overlay` function ```shell Gnuplot not found, using plotters backend 4args_with_3scalars/overlay/1024 time: [36.540 µs 36.560 µs 36.587 µs] change: [-12.476% -12.385% -12.284%] (p = 0.00 < 0.05) Performance has improved. Found 7 outliers among 100 measurements (7.00%) 2 (2.00%) high mild 5 (5.00%) high severe 4args_with_3scalars/overlay/4096 time: [141.54 µs 141.65 µs 141.82 µs] change: [-12.584% -12.425% -12.231%] (p = 0.00 < 0.05) Performance has improved. Found 11 outliers among 100 measurements (11.00%) 3 (3.00%) high mild 8 (8.00%) high severe 4args_with_3scalars/overlay/8192 time: [282.77 µs 283.42 µs 284.20 µs] change: [-13.658% -13.353% -12.997%] (p = 0.00 < 0.05) Performance has improved. Found 6 outliers among 100 measurements (6.00%) 3 (3.00%) high mild 3 (3.00%) high severe 4args_without_scalar/overlay/1024 time: [37.682 µs 37.717 µs 37.757 µs] change: [+1.8225% +1.9984% +2.1754%] (p = 0.00 < 0.05) Performance has regressed. Found 13 outliers among 100 measurements (13.00%) 4 (4.00%) high mild 9 (9.00%) high severe 4args_without_scalar/overlay/4096 time: [147.68 µs 147.77 µs 147.91 µs] change: [+2.7595% +3.0052% +3.2531%] (p = 0.00 < 0.05) Performance has regressed. Found 20 outliers among 100 measurements (20.00%) 4 (4.00%) high mild 16 (16.00%) high severe 4args_without_scalar/overlay/8192 time: [298.84 µs 299.63 µs 300.27 µs] change: [+1.6336% +2.0972% +2.5438%] (p = 0.00 < 0.05) Performance has regressed. Found 1 outliers among 100 measurements (1.00%) 1 (1.00%) high mild ``` #### Discussion🤔 According to the benchmark, there can be about a 12% performance improvement 🚀 when there are 3 scalar args; however, when all args are arrays, there is a 2% ~ 3% performance loss 😔. Does anyone have any ideas on how to avoid this loss? ## What changes are included in this PR? Currently, this approach has only been validated based on the `overlay` function. If everyone thinks it's appropriate, it can be applied to other functions as well. ## 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)? --> ## 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. --> -- 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]
