MassivePizza commented on PR #12318:
URL: https://github.com/apache/arrow-rs/pull/12318#issuecomment-7052199941

   This path was being hit when using ptars (protobuf to arrow), which often 
casts i64 to timestamp. This only showed up on profiles of small batches, and 
the extra arms felt like the cheapest fix. Maybe you're right that it's unfair 
to add arms for this but not other cases :)
   
   I also actually attempted to add `Array::to_arc(&self) -> Arc<dyn Array>`, 
initially thinking it was pointless, but didn't realize that `cast(&dyn Array)` 
could call `&Arc<dyn Array>` (I thought `Arc` would deref into the inner `dyn 
Array`). 
   I don't see what's blocking `Array::to_arc`, so I added TODO above the 
slice. 
   
   `to_arc` (just cloning) should also be slightly faster than `slice` as 
slicing `NullBuffer` does a popcount, and I didn't find any good way to avoid 
that without regressing all `NullBuffer::slice` calls.
   


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