dnssd
dnssd copied to clipboard
mdnsConn.readInto() high cpu usage
I am see periodic high cpu usage of my HimeKit app and I am try to detect what wrong.
As show pprof/profile
info - 36% cpu time spend on call net.InterfaceByIndex():
As I am see from sources https://github.com/brutella/dnssd/blob/master/mdns.go#L233 - net.InterfaceByIndex() called on each udp packet received.
May be cache interfaces info instead of get this info from system on every incoming udp packet?
Another possibility would be no to call net.InterfaceByIndex
at all and only work with the iface.Index
(the debug messages will be less clear)