feat: optimize construction of outgoing packets by bdraco · Pull Request #1118 · python-zeroconf/python-zeroconf
This is ~27% speed up. We can get some more by optimizing the packing but the bulk of the run time is incoming so its likely not worth the maintenance burden to keep the pxd file in sync unless someone has a use case were they construct many outgoing packets.
So the first is parsing the incoming message, its much smaller. Not much more we can do there
The rest is handling the question or responses.
Handle response is mostly cache lookups
Might make sense to do a pxd for the cache so we could make dns_entry_matches a cdef since it's called all over the place
Might not be worth the effort though as we already met the goal of cutting the base load cpu usage by 50% with this PR getting us over the mark
While the tests cover this 100%, I left it running overnight on 2 production systems to be sure there weren't any unexpected side effects and everything looks good this morning.
bdraco
marked this pull request as ready for review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters


