Skip to content

feat: speed up the query handler#1350

Merged
bdraco merged 12 commits into
masterfrom
handle_assembled_query
Dec 19, 2023
Merged

feat: speed up the query handler#1350
bdraco merged 12 commits into
masterfrom
handle_assembled_query

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Dec 19, 2023

handle_assembled_query was still a bound method on the Zeroconf object. It can be moved to the query handler like we did for the record manager. This meant the listener had to jump back into the python stack for every answer packet when most of them will never be responded to.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b9aae1d) 99.75% compared to head (164eff5) 99.75%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1350   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files          30       30           
  Lines        3240     3243    +3     
  Branches      536      536           
=======================================
+ Hits         3232     3235    +3     
  Misses          5        5           
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdraco bdraco marked this pull request as ready for review December 19, 2023 05:15
@bdraco bdraco merged commit 9eac0a1 into master Dec 19, 2023
@bdraco bdraco deleted the handle_assembled_query branch December 19, 2023 05:15
Comment on lines +431 to +438
out_queue = self.zc.out_queue
out_queue.async_add(now, question_answers.mcast_aggregate)
if question_answers.mcast_aggregate_last_second:
# https://datatracker.ietf.org/doc/html/rfc6762#section-14
# If we broadcast it in the last second, we have to delay
# at least a second before we send it again
out_delay_queue = self.zc.out_delay_queue
out_delay_queue.async_add(now, question_answers.mcast_aggregate_last_second)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out_queue and out_delay_queue never change, we could rebind them to the QueryHandler object to avoid the getattr here but it probably doesn't make much difference as they should rarely be called in practice

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.

1 participant