Skip to content
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

Merged
merged 28 commits into from
Nov 14, 2023
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Nov 14, 2023

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

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (55cf4cc) 99.77% compared to head (904824b) 99.77%.
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@bdraco bdraco marked this pull request as draft November 14, 2023 17:52
@bdraco bdraco changed the title feat: small speed up to dns records feat: small speed up to processing incoming dns records 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
Copy link
Member Author

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

@bdraco bdraco marked this pull request as ready for review November 14, 2023 22:58
@bdraco bdraco merged commit bfe4c24 into master Nov 14, 2023
31 checks passed
@bdraco bdraco deleted the dns_typing_2 branch November 14, 2023 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant