← Sunday, October 11, 2026Performance & OSDeep dive
NumPy 2.5 speeds up `searchsorted` by up to 25×
A vectorized binary-search formulation was ported into NumPy 2.5 and measured at up to 25× faster than NumPy 2.4. The techniques may also inform performance work in scientific Python libraries that depend on search operations.
- What
- NumPy 2.5 includes a vectorized `searchsorted` implementation for batched queries against a static sorted array.
- How
- It tracks each search’s `lo` and `hi` in arrays and updates them together with NumPy operations, avoiding sequential Python searches.
- Why it matters
- The change achieved up to a 25× benchmark speedup and can benefit scientific libraries that use `searchsorted`.
Read on blog.scientific-python.org → Lobsters · 3 comments
Discussion
Discussion is not switched on yet. Use Note above to keep your own thoughts on this story.
Headline, summary, brief and diagram are written by a model from the source's own text; the link, byline and numbers come from the source. Read the original before relying on a claim.