Which optimisation? `searchsorted`? or cutting off after full recall?

The reason for not cutting from 0 recall is that even while recall remains 0, precision drops with every decrease in threshold. Similarly, while precision is 1, recall increases with every decrease in threshold. The reason for cutting from the full recall end is that that's what's used for calculating average precision; and in a classification (rather than retrieval) task, it's perhaps not so interesting how many responses remained under the threshold that gave full recall.