6× faster binary search: from compiled code to mechanical sympathy
enz
15 points
3 comments
July 12, 2026
Related Discussions
Found 5 related stories in 790.6ms across 14,015 title embeddings via pgvector HNSW
- Static search trees: 40x faster than binary search (2024) lalitmaganti · 82 pts · July 17, 2026 · 59% similar
- You can beat the binary search signa11 · 21 pts · April 30, 2026 · 57% similar
- Rethinking search as code generation 1zael · 69 pts · June 02, 2026 · 47% similar
- The future of code search is not regex – 100x faster than ripgrep neogoose · 14 pts · April 02, 2026 · 46% similar
- SereneDB's C++ search engine is the fastest on search benchmarks gnusi · 31 pts · March 19, 2026 · 46% similar
Discussion Highlights (2 comments)
pillmillipedes
I think putting the buckets in eytzinger layout might help with cache locality here? though on the other hand they might all fit into cache anyways.. I'd also want to try interpolation search for this (not necessarily linear interpolation since we're doing floats) - you can take much better guesses than "it's in the middle somewhere" by not having to look at the data through a 1-bit-wide pinhole as comparison algorithms do.
moi2388
“ How do you speed up computational Python code? A common, and useful, starting point is” A better starting point is: use a better language. Python is terrible and unbearably slow. If you need anything serious or performant, switch to something else.