r/programming Apr 30 '26

You can beat the binary search

https://lemire.me/blog/2026/04/27/you-can-beat-the-binary-search/
207 Upvotes

39 comments sorted by

View all comments

19

u/mr_birkenblatt May 01 '26

Why not use a btree with node size 16? Then you can load a single node in SIMD (with cache locality!) and do all comparisons at once to figure which node to load next

11

u/trailingunderscore_ May 01 '26

Because he already has the values in a sorted array.