-
Notifications
You must be signed in to change notification settings - Fork 227
feat: optimize the dns cache #1119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
432f90b
fix: handle non-import
bdraco f3c4765
fix: reduce for first pass
bdraco 4994ad9
fix: compiler crash
bdraco 4951e81
fix: compiler crash
bdraco 7de5b1b
fix: compiler crash
bdraco 837b389
fix: compiler
bdraco 6ce07c6
Merge branch 'master' into dns_pxd_v2
bdraco 098b1ba
fix: hide some types from cython that we do not want resolved
bdraco fa728de
Merge remote-tracking branch 'origin/dns_pxd_v2' into dns_pxd_v2
bdraco efa3a91
fix: cache uses DNSRecord not DNSEntry
bdraco a4f116e
fix: cache uses DNSRecord not DNSEntry
bdraco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import cython | ||
| from ._dns cimport ( | ||
| DNSAddress, | ||
| DNSEntry, | ||
| DNSHinfo, | ||
| DNSPointer, | ||
| DNSRecord, | ||
| DNSService, | ||
| DNSText, | ||
| ) | ||
|
|
||
|
|
||
| cdef object _TYPE_PTR | ||
|
|
||
| cdef _remove_key(cython.dict cache, object key, DNSRecord record) | ||
|
|
||
|
|
||
| cdef class DNSCache: | ||
|
|
||
| cdef public cython.dict cache | ||
| cdef public cython.dict service_cache | ||
|
|
||
| cdef _async_add(self, DNSRecord record) | ||
|
|
||
| cdef _async_remove(self, DNSRecord record) | ||
|
|
||
|
|
||
| cdef _dns_record_matches(DNSRecord record, object key, object type_, object class_) |
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
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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