Array Layouts for Comparison-Based Searching
Paul-Virak Khuong, Pat Morin

TL;DR
This paper compares array layouts and search algorithms for efficient comparison-based searching, finding that Eytzinger layout outperforms traditional methods for large arrays on modern hardware.
Contribution
It provides an extensive empirical evaluation of various array layouts and search algorithms, revealing that Eytzinger layout is most effective for large arrays, contrary to prior assumptions.
Findings
Eytzinger layout is fastest for large arrays on modern hardware.
Sorted order with binary search is best for small arrays.
Branch prediction and prefetching improve search performance.
Abstract
We attempt to determine the best order and search algorithm to store comparable data items in an array, , of length so that we can, for any query value, , quickly find the smallest value in that is greater than or equal to . In particular, we consider the important case where there are many such queries to the same array, , which resides entirely in RAM. In addition to the obvious sorted order/binary search combination we consider the Eytzinger (BFS) layout normally used for heaps, an implicit B-tree layout that generalizes the Eytzinger layout, and the van Emde Boas layout commonly used in the cache-oblivious algorithms literature. After extensive testing and tuning on a wide variety of modern hardware, we arrive at the conclusion that, for small values of , sorted order, combined with a good implementation of binary search is best. For larger values of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · Advanced Data Storage Technologies · DNA and Biological Computing
