feat: optimize the dns cache by bdraco · Pull Request #1119 · python-zeroconf/python-zeroconf
Conversation
This adds a pxd file for _cache.py and cleans up the one for _dns.py
This also fixes some conflating of DNSRecord and DNSEntry
| @@ -487,7 +483,7 @@ def __eq__(self, other: Any) -> bool: | |||
| isinstance(other, DNSNsec) | |||
| and self.next_name == other.next_name | |||
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move all the checks after the isinstance into a cdef with the other typed to the same type which will avoid all the python accessor overhead since we can access the struct values in C instead
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