Rather than iteratively checking all sufficiently large heaps during search, maintain and use a bitmap in order to skip empty heaps.
Rather than iteratively checking all sufficiently large heaps during search, maintain and use a bitmap in order to skip empty heaps.