Open Jarred-Sumner opened 1 year ago
c-ares does no caching which means repeated queries to the same hostnames will be slower than system dns
Unlike getaddrinfo, c-ares includes the TTL for the DNS query. That means we can do caching with it
getaddrinfo
Zig's standard library doesn't have an LRU we can just use. Maybe could wrap std.PriorityQueue but it's not precisely the same thing
std.PriorityQueue
Looks like we can get this for free by upgrading to c-ares v1.31.0: https://github.com/c-ares/c-ares/blob/063379049f9d43fc08bc74a7fe8639add88730ef/src/lib/ares_options.c#L458
c-ares does no caching which means repeated queries to the same hostnames will be slower than system dns
Unlike
getaddrinfo
, c-ares includes the TTL for the DNS query. That means we can do caching with itZig's standard library doesn't have an LRU we can just use. Maybe could wrap
std.PriorityQueue
but it's not precisely the same thing