Skip to content

feat: speed up instances only used to lookup answers#1307

Merged
bdraco merged 3 commits into
masterfrom
avoid_query_path_empty_registry
Nov 12, 2023
Merged

feat: speed up instances only used to lookup answers#1307
bdraco merged 3 commits into
masterfrom
avoid_query_path_empty_registry

Conversation

@bdraco
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
@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.

1 participant