You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/08 08:07:25 UTC

[GitHub] [arrow] wesm commented on pull request #10679: ARROW-13170 [C++] Reducing branching in compute/kernels/vector_selection.cc

wesm commented on pull request #10679:
URL: https://github.com/apache/arrow/pull/10679#issuecomment-876226830


   I guess branch prediction works really well on modern processors — when the filter values are mostly false then the if block is rarely executed. In the 50% selected case, branch prediction doesn't help so this method yields speedups. 
   
   Not sure if it's worth investigating, but moving `out_position_` from a class member to a stack variable could have some performance impact. Another thought is removing some of the offset arithmetic
   
   Lastly, since we're using `SetBitTo` a lot, it might be worth checking the superscalar variant described at
   
   https://graphics.stanford.edu/~seander/bithacks.html#ConditionalSetOrClearBitsWithoutBranching


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