perf: next() stops scanning at the first available proxy

T3-18: _next_from_list scanned and collected every available proxy, then used
only the first (8.6 ms per call at 10k proxies). break after the first; the
selection order and log levels are identical (verified over full cycles with
burns, dead proxies, cooldown and the all-cooling fallthrough), ~1.8 us/call
at any pool size.

Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
dsql committed 2026-10-16 04:35:29 -04:00
1 parent 4d5caac8d8
commit 56f8e3d878
1 file changed
+2
+2
View File
@@ -173,6 +173,8 @@ class AioProxies:
if self._available(state["timeout"], now):
fine.append(idx)
self._clear_stale_burn(state)
# only the first available proxy is used; scanning on is O(pool) per call
break
if fine:
chosen = fine[0]