Dandandan commented on PR #7457:
URL: https://github.com/apache/arrow-rs/pull/7457#issuecomment-2851960427

   > > What do we want to do with the API breakage? I think it would be nice to 
avoid the unsafe / move to Iterator::collect (and get some perf. improvement), 
but using `ArrayAccessor` or even `ArrayIter` I think still needs the use of 
the unsafe API's to avoid big regressions (in large part because of 
https://doc.rust-lang.org/std/iter/trait.TrustedLen.html is not stable). We can 
also look at what makes the difference in performance from time to time and 
change `from_trusted_len_iter`
   > 
   > Why do we need trusted_len if we know both inputs are `Array`s?
   
   `TrustedLen` (https://doc.rust-lang.org/std/iter/trait.TrustedLen.html) is 
required for collecting into `Vec` to be performant.
   `ArrayAccessor` or `Array` can not give that guarantee, as we cannot 
implement `TrustedLen` in non-nightly rust for our own types.
   
   Currently the same code relies on `Buffer::from_trusted_len_iter` for the 
same reason, only in this case the caller is responsible for ensuring the iter 
is of "trusted len".


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

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

Reply via email to