feat: small speed up to processing incoming dns records#1315
Merged
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.
bdraco
commented
Nov 14, 2023
Comment on lines
+154
to
+177
| @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 |
Member
Author
There was a problem hiding this comment.
These shouldn't be accessed publicly but do in tests so I was worried about removing them as it could be a breaking change
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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