logoalt Hacker News

quirinoyesterday at 4:07 PM1 replyview on HN

On optimizing binary search: https://en.algorithmica.org/hpc/data-structures/binary-searc...


Replies

garaetjjteyesterday at 5:05 PM

I once did have a need for binary search in memory mapped files and I experimented with Eytzinger layout (which I learned from https://bannalia.blogspot.com/2015/06/cache-friendly-binary-...). It turned out that it was slower than plain binary search, I think because keys I was looking up were often clumped together thus it played quite well with cache anyway.