Binary search is a fast algorithm but suffers from predictability issues on modern CPUs. This post explores the Eytzinger layout to improve memory access predictability and introduces a branchless version of the Eytzinger binary search. It also discusses the benefits of using software memory prefetching to further enhance performance.
Table of contents
IntroductonEytzinger LayoutBranchless Eytzinger implementatationBranchless Eytzinger with memory prefetchConclusionRelated linksSort: