You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Binary searches over member and node refs visit ids in no particular order #230
Several lookups test the node refs of a way, or the members of a relation, against a sorted vector:
binary_search_for_id (core/datatypes.h): way geometry (make_geometry) and relation geometry (relation_geometry_store.cc).
binary_search_for_pair_id (core/datatypes.h): relation members in the bbox filter, the around filter and member collection.
has_a_child_with_id and has_a_child_with_id_and_role (data/abstract_processing.h): way(bn), rel(bn), rel(bw), rel(br) and their role forms.
The refs come in path or member order, so the ids looked up jump around, and about half of a branchy binary search's branches mispredict. A branchless (monobound) search avoids that.
This is the opposite of the call sites in #227 and #229, where lookups mostly ascend (#228). On x86, #227's monobound search was faster even there; on ARM it was slower. This issue tracks measuring the monobound search where it should help most: at the unpredictable lookups only.
Activity