back
1 comments
For those interested, this is a place where PyPy shines over the CPython implementation. With 2.7 the benchmark reports a 40x or 50x performance hit from the linear ("obviously fast but isn't") vs. the binary search, which does more object creation in order to push the comparison tests to C.

But with PyPy 1.5 I consistently find that the linear search is at least as fast as the binary search.

(The benchmark uses a random single character change in a large string, hence the variability of the answers.)