numpy/numpy — pull request #4244 by jaimefrio (2014-01-30 07:33:00+00:00)
Title: ENH: Type specific binary search functions for `searchsorted`

This PR replaces the generic binary search functions used by `searchsorted`
with type specific ones for numeric types. This results in a speed-up of
calls to `searchsorted` which is highly dependent on the size of the
'haystack' and the 'needle', with typical values for large enough needles
in the 1.5x - 3.0x for direct searches (i.e. without a `sorter` argument)
and 1.2x - 2.0x for indirect searches. A summary benchmark on float and
int arrays can be found [here](https://gist.github.com/jaimefrio/8704101).

Furthermore, the type specific binary search functions can take strided
inputs for all their arguments, which is a step in the right direction to
eventually add an `axis` argument to `searchsorted`.