News for hackers. Stuff that matters.
Re:Beautiful branchless binary search by coppsilgold on Friday April 28, 2023 @02:53AM (#35738297)
Cache associativity, conflict miss. When too many memory addresses which are far apart map to the same cache lines while being used and reused in quick succession, causing cache evictions.

Scott Meyers had a very good talk which contained this information: <https://youtu.be/WDIkqP4JbkE?t=3614>

Re:Beautiful branchless binary search by jove_ on Friday April 28, 2023 @07:35AM (#35740021)
Size also matters for this problem. The effect of it is to slash your processor's cache size. If your problem is small enough that it fits in the cache anyway you won't see the effects. That said, unless the cache is hot, it shouldn't make a difference in the first place. Moreover I'm pretty confident in guessing that with a cold cache, the difference between the algorithms would vanish.