You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Dandandan (via GitHub)" <gi...@apache.org> on 2025/04/18 16:01:53 UTC
[PR] Speedup take_bytes (-35% -65%) [arrow-rs]
Dandandan opened a new pull request, #7422:
URL: https://github.com/apache/arrow-rs/pull/7422
# 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.
-->
```
take str 512 time: [4.6226 µs 4.6253 µs 4.6280 µs]
change: [-37.070% -36.813% -36.567%] (p = 0.00 < 0.05)
Performance has improved.
Found 20 outliers among 100 measurements (20.00%)
3 (3.00%) low severe
7 (7.00%) low mild
4 (4.00%) high mild
6 (6.00%) high severe
take str 1024 time: [10.308 µs 10.312 µs 10.318 µs]
change: [-66.619% -66.148% -65.664%] (p = 0.00 < 0.05)
Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
3 (3.00%) high mild
10 (10.00%) high severe
take str null indices 512
time: [4.1411 µs 4.1552 µs 4.1670 µs]
change: [-34.711% -29.494% -23.966%] (p = 0.00 < 0.05)
Performance has improved.
Found 15 outliers among 100 measurements (15.00%)
11 (11.00%) low severe
4 (4.00%) low mild
take str null indices 1024
time: [8.1308 µs 8.6518 µs 9.2178 µs]
change: [-51.207% -48.019% -44.389%] (p = 0.00 < 0.05)
Performance has improved.
take str null values 1024
time: [5.0454 µs 5.0491 µs 5.0542 µs]
change: [-36.847% -35.929% -35.100%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
2 (2.00%) high mild
8 (8.00%) high severe
```
Closes #.
# 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.
-->
# 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.
-->
# 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 call them out.
-->
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speedup take_bytes (-35% -69%) by precalculating capacity [arrow-rs]
Posted by "mbutrovich (via GitHub)" <gi...@apache.org>.
mbutrovich commented on PR #7422:
URL: https://github.com/apache/arrow-rs/pull/7422#issuecomment-2828165274
I will take a proper review pass this afternoon.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speedup take_bytes (-35% -69%) by precalculating capacity [arrow-rs]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on PR #7422:
URL: https://github.com/apache/arrow-rs/pull/7422#issuecomment-2825068017
> Is it fair to say that in general you've done a few refactors recently that replace `MutableBuffer` with `Vec` or collecting directly into the target `Buffer` type? Is there a particular pattern with `MutableBuffer` that we should be avoiding?
I think at this point there is little point in using `MutableBuffer` over `Vec` as the latter provides more performant (specialization over `T`, better inlining), slightly more safe and more complete API. The same probably applies for a lot of `Builder`-type APIs probably.
It might be worth spending some time documenting the best and most performant way to construct / transform Arrow arrays and apply it accross the arrow-rs create (marking stuff as deprecated if needed).
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speedup take_bytes (-35% -69%) by precalculating capacity [arrow-rs]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on PR #7422:
URL: https://github.com/apache/arrow-rs/pull/7422#issuecomment-2820110519
This is ready now
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speedup take_bytes (-35% -69%) by precalculating capacity [arrow-rs]
Posted by "mbutrovich (via GitHub)" <gi...@apache.org>.
mbutrovich commented on PR #7422:
URL: https://github.com/apache/arrow-rs/pull/7422#issuecomment-2824514226
Is it fair to say that in general you've done a few refactors recently that replace `MutableBuffer` with `Vec` or collecting directly into the target `Buffer` type? Is there a particular pattern with `MutableBuffer` that we should be avoiding?
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speedup take_bytes (-35% -69%) by precalculating capacity [arrow-rs]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on PR #7422:
URL: https://github.com/apache/arrow-rs/pull/7422#issuecomment-2829456265
> Do you see the same performance regression for `take stringview`? I'm still just digging into the code to see if that is even possible.
>
> Main:
>
> ```
> take stringview 512 time: [287.26 ns 287.75 ns 288.28 ns]
>
> take stringview 1024 time: [489.07 ns 489.99 ns 491.18 ns]
> ```
>
> PR:
>
> ```
> take stringview 512 time: [360.36 ns 361.02 ns 361.95 ns]
>
> take stringview 1024 time: [633.66 ns 633.79 ns 633.98 ns]
> ```
I am not at a machine right now to test, but StringView doesn't use this code path.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speedup take_bytes (-35% -69%) by precalculating capacity [arrow-rs]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan merged PR #7422:
URL: https://github.com/apache/arrow-rs/pull/7422
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speedup take_bytes (-35% -69%) by precalculating capacity [arrow-rs]
Posted by "mbutrovich (via GitHub)" <gi...@apache.org>.
mbutrovich commented on PR #7422:
URL: https://github.com/apache/arrow-rs/pull/7422#issuecomment-2830148762
> I am not at a machine right now to test, but StringView doesn't use this code path.
Generated code looks the same, so must be some sort of noise on my machine.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speedup take_bytes (-35% -69%) by precalculating capacity [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7422:
URL: https://github.com/apache/arrow-rs/pull/7422#issuecomment-2838771706
> > I think at this point there is little point in using `MutableBuffer` over `Vec` as the latter provides more performant (specialization over `T`, better inlining), slightly more safe and more complete API. The same probably applies for a lot of `Builder`-type APIs probably.
> > It might be worth spending some time documenting the best and most performant way to construct / transform Arrow arrays and apply it accross the arrow-rs create (marking stuff as deprecated if needed).
>
> This LGTM and is a great improvement. I also would love to see this documentation if you don't mind dumping your thoughts on the topic while they're fresh!
- Filed https://github.com/apache/arrow-rs/issues/7455
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Speedup take_bytes (-35% -69%) by precalculating capacity [arrow-rs]
Posted by "mbutrovich (via GitHub)" <gi...@apache.org>.
mbutrovich commented on PR #7422:
URL: https://github.com/apache/arrow-rs/pull/7422#issuecomment-2828282785
Do you see the same performance regression for `take stringview`? I'm still just digging into the code to see if that even seems possible.
Main:
```
take stringview 512 time: [287.26 ns 287.75 ns 288.28 ns]
take stringview 1024 time: [489.07 ns 489.99 ns 491.18 ns]
```
PR:
```
take stringview 512 time: [360.36 ns 361.02 ns 361.95 ns]
take stringview 1024 time: [633.66 ns 633.79 ns 633.98 ns]
```
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org