Improving Linear Search Performance Using x86 AVX

Linear search is one of the simplest algorithms for finding a value in a sequence. It has a worst-case time complexity of \(O(n)\), making it asymptotically less efficient than algorithms such as binary search, which performs lookups in \(O(\log n)\) on sorted data. If the data is initially unsorted, however, it must first be sorted at a cost of \(O(n \log n)\). For a single lookup, this preprocessing cost makes sorting followed by binary search slower than a linear scan. Binary search becomes advantageous when the same dataset is searched repeatedly. ...

July 20, 2026 · 18 min · rakitin