You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "rluvaton (via GitHub)" <gi...@apache.org> on 2024/09/14 23:02:06 UTC

[PR] use `BooleanBuffer::collect_bool` in the make_comparator documentation example [arrow-rs]

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

   # Which issue does this PR close?
   
   No issue as there were no bug or feature requests behind it
   
   # Rationale for this change
    
   using `BooleanBuffer::collect_bool` is supposed to be faster as it eliminates the conditional `Iterator::next`
   
   # What changes are included in this PR?
   
   update docs example from:
   
   ```rust
   let values = (0..len).map(|i| cmp(i, i).is_eq()).collect();
   ```
   
   to :
   ```rust
   let values = BooleanBuffer::collect_bool(len, |i| cmp(i, i).is_eq());
   ```
   
   # Are there any user-facing changes?
   
   Nope
   


-- 
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] use `BooleanBuffer::collect_bool` in the make_comparator documentation example [arrow-rs]

Posted by "rluvaton (via GitHub)" <gi...@apache.org>.
rluvaton closed pull request #6395: use `BooleanBuffer::collect_bool` in the make_comparator documentation example
URL: https://github.com/apache/arrow-rs/pull/6395


-- 
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] use `BooleanBuffer::collect_bool` in the make_comparator documentation example [arrow-rs]

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #6395:
URL: https://github.com/apache/arrow-rs/pull/6395#issuecomment-2351486369

   In this case it is unlikely to be faster, as the comparator contains a dyn dispatch, and will result in more codegen. Do you perhaps have a benchmark showing it is faster in this case?


-- 
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] use `BooleanBuffer::collect_bool` in the make_comparator documentation example [arrow-rs]

Posted by "rluvaton (via GitHub)" <gi...@apache.org>.
rluvaton commented on PR #6395:
URL: https://github.com/apache/arrow-rs/pull/6395#issuecomment-2351508081

   I'm fairly new to Rust, where can I learn more about why this would not necessarily be faster?


-- 
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] use `BooleanBuffer::collect_bool` in the make_comparator documentation example [arrow-rs]

Posted by "rluvaton (via GitHub)" <gi...@apache.org>.
rluvaton commented on PR #6395:
URL: https://github.com/apache/arrow-rs/pull/6395#issuecomment-2351507719

   Only the docs:
   https://github.com/apache/arrow-rs/blob/ba85fa3bc68fd6fdc2b401adcf5eddb9f482b7c9/arrow-buffer/src/buffer/mutable.rs#L449-L454


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