jorgecarleitao commented on pull request #9413:
URL: https://github.com/apache/arrow/pull/9413#issuecomment-773725629


   > I think the compiler should be able to prove most of those assertions 
statically, so maybe we don't need an unsafe variant and could leave the 
assertions in.
   > 
   > For example, when the buffer is created via `from_trusted_len_iter`, that 
method calculates the length by multiplying with `size_of::<T>()` and allocates 
and writes into a suitable aligned buffer. This knowledge should allow the 
compiler to remove the corresponding assertions in `ArrayData::new_primitive`.
   
   That is a good hypothesis. I will do some benchmarking to test it, and if it 
holds, I will replace them.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to