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 45.4ms across 5,215 title embeddings via pgvector HNSW
- Static search trees: 40x faster than binary search (2024) lalitmaganti · 82 pts · July 17, 2026 · 59% similar
- Show HN: I've built a words game based on binary search ludovicianul · 47 pts · July 16, 2026 · 44% similar
- Auto-research with codex: How I achieved a 232x Faster Kernel tosh · 412 pts · August 15, 2026 · 43% similar
- ProgramBench Vetted: Reverse Engineering from a Runnable Binary rigelbm · 13 pts · August 20, 2026 · 41% similar
- Your code is fast – if you're lucky chrka · 124 pts · July 11, 2026 · 40% 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.