mapleFU opened a new issue, #41687:
URL: https://github.com/apache/arrow/issues/41687

   ### Describe the enhancement requested
   
   I see the pr removed the `kBitMask` in arrow-rs[1]. Besides, abseil mentions 
that this optimization is useless in Haswell machine [2][3], and this might 
also suffer from cache eviction. Should we trying to remove them and use 
something like above:
   
   ```c++
   // Bitmask selecting the k-th bit in a byte
   // static constexpr uint8_t kBitmask[] = {1, 2, 4, 8, 16, 32, 64, 128};
   static constexpr uint8_t GetBitMask(uint8_t index) {
     // DCHECK(index >= 0 && index <= 7);
     return static_cast<uint8_t>(1) << index;
   }
   
   // the bitwise complement version of kBitmask
   // static constexpr uint8_t kFlippedBitmask[] = {254, 253, 251, 247, 239, 
223, 191, 127};
   static constexpr uint8_t GetFlippedBitMask(uint8_t index) {
     // DCHECK(index >= 0 && index <= 7);
     return ~(static_cast<uint8_t>(1) << index);
   }
   ```
   
   [1] https://github.com/apache/arrow-rs/issues/5771
   [2] https://abseil.io/fast/9
   [3] https://abseil.io/fast/39
   
   ### Component(s)
   
   C++


-- 
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: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to