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: speed up instances only used to lookup answers #1307

Merged
merged 3 commits into from
Nov 12, 2023

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Nov 12, 2023

If there is nothing in the ServiceRegistry we would still process incoming questions. If we have no answers to give, we can skip the handling of queries completely as it significantly reduces cpu time.

This is expected to significantly reduce cpu time for one shot usage and consumers that only use zeroconf to lookup answers.

If there is nothing in the ServiceRegistry we would still
process incoming questions. If we have no answers to give,
we can skip the handling queries completely as it significantly
reduces cpu time.
@bdraco bdraco force-pushed the avoid_query_path_empty_registry branch from 3b9e5e8 to 7c05293 Compare November 12, 2023 05:26
Copy link

codecov bot commented Nov 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
src/zeroconf/__init__.py 100.00% <100.00%> (ø)
src/zeroconf/_listener.py 100.00% <100.00%> (ø)
src/zeroconf/_services/registry.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!

@bdraco
Copy link
Member Author

bdraco commented Nov 12, 2023

That dropped the esphome background cpu quite a bit. How did I miss this for so many years?

@bdraco bdraco marked this pull request as ready for review November 12, 2023 05:41
@bdraco bdraco merged commit 0701b8a into master Nov 12, 2023
34 checks passed
@bdraco bdraco deleted the avoid_query_path_empty_registry branch November 12, 2023 05:42
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