feat: optimize the dns cache by bdraco · Pull Request #1119 · python-zeroconf/python-zeroconf

Conversation

@bdraco

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

@codecov-commenter

bdraco

@@ -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

@bdraco bdraco marked this pull request as ready for review

December 21, 2022 20:38

2 participants

@bdraco @codecov-commenter