alamb edited a comment on issue #29:
URL: https://github.com/apache/arrow-rs/issues/29#issuecomment-826746621


   Comment from Paul Kernfeld(paulkernfeld) @ 2019-01-24T00:13:03.622+0000:
   <pre>I'm interested in working on this, although there could be a lot of 
downstream effects. A good example of a tricky function is 
arrow::array::PrimitiveArray::value, which appears to be used in a couple dozen 
places. A few possible strategies are:
    # Add in bounds checking so that we don't need to deal with unsafe at all.
    # Propagate the unsafes up through the code.
    # Maintain a safe and unsafe version of each function that is currently 
unsafe.
   
   Personally I'm a fan of #1 because I think that reducing unsafe code will 
help developers and users avoid mistakes (I [accidentally 
wrote|https://github.com/apache/arrow/pull/3448] a nondeterministic unit test 
earlier this week). However, I'm new to the project so I'm happy to do what 
others think is best.</pre>
   
   Comment from Paddy Horan(paddyhoran) @ 2019-01-24T01:35:09.674+0000:
   <pre>I was actually thinking we would need #3.  Taking `value` as an example 
I would be in favor of adding bounds checking to `value` and having a 
`value_unchecked` that does no bounds checking and is unsafe.
   
   I think that we need to provide the unsafe versions for maximum performance 
due to Arrow often being described as a development platform rather than a 
front end API.  i.e. people will use it as the foundation of other higher level 
libraries and so developers will want the option to avoid bounds checking for 
performance reasons.
   
    </pre>


-- 
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:
us...@infra.apache.org


Reply via email to