-
Notifications
You must be signed in to change notification settings - Fork 219
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
feat: small speed up to processing incoming dns records #1315
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1315 +/- ##
=======================================
Coverage 99.77% 99.77%
=======================================
Files 29 29
Lines 3053 3068 +15
Branches 513 516 +3
=======================================
+ Hits 3046 3061 +15
Misses 5 5
Partials 2 2 ☔ View full report in Codecov by Sentry. |
This reverts commit 191806f.
@property | ||
def questions(self) -> List[DNSQuestion]: | ||
"""Questions in the packet.""" | ||
return self._questions | ||
|
||
@property | ||
def num_questions(self) -> int: | ||
"""Number of questions in the packet.""" | ||
return self._num_questions | ||
|
||
@property | ||
def num_answers(self) -> int: | ||
"""Number of answers in the packet.""" | ||
return self._num_answers | ||
|
||
@property | ||
def num_authorities(self) -> int: | ||
"""Number of authorities in the packet.""" | ||
return self._num_authorities | ||
|
||
@property | ||
def num_additionals(self) -> int: | ||
"""Number of additionals in the packet.""" | ||
return self._num_additionals |
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.
These shouldn't be accessed publicly but do in tests so I was worried about removing them as it could be a breaking change
roughly a ~7% speed up for incoming
before: Parsing 100000 incoming messages took 2.558975583058782 seconds
after: Parsing 100000 incoming messages took 2.3616396670695394 seconds
roughly a ~2% speed up for outgoing (mostly a side effect)
before: Construction 100000 outgoing messages took 1.9390459168935195 seconds
after: Construction 100000 outgoing messages took 1.8946991249686107 seconds