peer_matches_rf_source() runs for every hotspot on every group voice frame
(_peer_should_receive_dmrd). It matched every peer of the MASTER against the
source with _fuzzy_peer_matches() and then looked for this peer in the list:
O(peers) per hotspot, O(peers^2) per frame, each step converting a key to int
and str. The answer only depends on this peer's own ID, so it is now checked
directly with the same rule (_peer_id_matches, shared with
_fuzzy_peer_matches). Peers stored with int/str keys keep the scan, which
normalises them.
Measured with tests/support/hbp_repeat_stack (REPEAT MASTER, group voice on a
static TG, 2,880 frames x 3 runs, Raspberry Pi 5), µs per frame:
peers 1: 143 -> 146
peers 5: 600 -> 572
peers 20: 2711 -> 2079 (-23 %)
peers 50: 8792 -> 5126 (-42 %)
Tests: direct cases (suffix, own ID, 5-digit prefix rule) and 300 randomised
peer tables (bytes, int and str keys) checked against the previous
implementation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG