Skip to content

mdnsConn.readInto() high cpu usage #32

@amurchick

Description

@amurchick

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():
Screen Shot 2022-03-23 at 13 49 05

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions