Dandandan commented on issue #19241:
URL: https://github.com/apache/datafusion/issues/19241#issuecomment-3634400513

   > > What about `slice::contains`? Seems like it should be somewhere between 
the const-sized approach and binary search in terms of threshold window.
   > 
   > It loses all the time against the branchless and the binary search. 
`slice::contains` is just a wrapper around:
   > 
   > self.iter().any(|y| y == x)
   > So it needs to do bounds checks and can't optimize for the small arrays.
   
   Hmm interesting. I would have thought it would be faster somwehere in 
between.
   Note it is not equal to `self.iter().any(|y| y == x)`, `slice::contains` is 
specialized for primitive types to create unrolled/vectorized code.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to