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 adding and removing RecordUpdateListeners #1253

Merged
merged 5 commits into from Sep 3, 2023

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Sep 3, 2023

Listeners were stored in a list which meant a linear search had to happen to remove them. We add/remove these quite a bit when resolving a service, also ESPHome churns these quite a bit when a device is offline.

Technically breaking change: Zeroconf.listeners now returns a set instead of a list
Technically breaking change: ServiceInfo.__eq__ is now the default python implementation as it wasn't hashable otherwise and comparing on name was wrong since it wasn't case aware

@codecov
Copy link

codecov bot commented Sep 3, 2023

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
src/zeroconf/_services/info.py ø
src/zeroconf/__init__.py 100.00%
src/zeroconf/_core.py 100.00%
src/zeroconf/_handlers/record_manager.py 100.00%

📢 Thoughts on this report? Let us know!.

@bdraco bdraco merged commit 22e4a29 into master Sep 3, 2023
33 of 34 checks passed
@bdraco bdraco deleted the record_manager_private branch September 3, 2023 17:26
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