Loading section...
Parallel Binary Search
Concepts: pyParallelBinarySearch, pyOfflineQueries
Parallel binary search is a technique for when you have Q independent queries that all binary search on the same sorted data or the same predicate. Instead of running Q separate binary searches at O(Q log N) with Q independent sequences of predicate evaluations, you batch all queries together and process them in O(log N) passes, where each pass evaluates all Q queries simultaneously. The result is still O(Q log N) total operations, but you gain significant constant-factor improvements when each pass processes multiple queries through the same expensive shared computation. When Parallel Binary Search Helps The gain is real when the cost of a single predicate evaluation involves shared state or shared computation that you pay once per pass regardless of how many queries you evaluate. Classic