⚡ Optimize system DNS resolution with asyncio.gather

Replaced sequential system DNS resolution in collect_dns_advanced
with concurrent execution using asyncio.gather. This addresses
a latency bottleneck when resolving multiple control names.

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot] 2026-08-19 11:42:05 +00:00
parent 053eb2f530
commit 27007bf412

View file

@ -141,7 +141,9 @@ async def collect_dns_advanced(
bogus_probe_name: str,
timeout: float,
) -> DnsAdvanced:
system_probes = [await resolve_system(name, timeout) for name in control_names]
system_probes = list(
await asyncio.gather(*(resolve_system(name, timeout) for name in control_names))
)
doh_probes: list[ResolverProbe] = []
for name in control_names:
doh_probes.extend(