haohuaijin commented on PR #11554:
URL: https://github.com/apache/arrow-rs/pull/11554#issuecomment-6193408825

   Thanks for the explanation! maybe we can extend `BitChunks` with a direct 
window read, along these lines?
   
   ```rust
   pub fn read_window(&self, position: usize) -> Option<u64> {
       let position = self.bit_offset + position;
       let window = self.buffer.get(position / 8..)?.first_chunk::<16>()?;
       Some((u128::from_le_bytes(*window) >> (position % 8)) as u64)
   }
   ```
   
   This would avoid aligning and combining two `chunk()` results. The caller 
could ignore unused high bits as it does now, with a separate padded read for 
the tail.


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

Reply via email to