Skip to content

Cache DNS record and question hashes#960

Merged
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:cache_hash
Aug 15, 2021
Merged

Cache DNS record and question hashes#960
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:cache_hash

Conversation

@bdraco

@bdraco bdraco commented Aug 15, 2021

Copy link
Copy Markdown
Member
  • The hash was being recalculated every time the object
    was being used in a set or dict. Since the hashes are
    effectively immutable, we only calculate them once now.

Closes #959

@bdraco bdraco force-pushed the cache_hash branch 4 times, most recently from 167816d to 4b79383 Compare August 15, 2021 13:58
@codecov-commenter

codecov-commenter commented Aug 15, 2021

Copy link
Copy Markdown

Codecov Report

Merging #960 (583c068) into master (1e60e13) will decrease coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##            master     #960      +/-   ##
===========================================
- Coverage   100.00%   99.87%   -0.13%     
===========================================
  Files           22       22              
  Lines         2436     2446      +10     
  Branches       401      401              
===========================================
+ Hits          2436     2443       +7     
- Misses           0        2       +2     
- Partials         0        1       +1     
Impacted Files Coverage Δ
zeroconf/_dns.py 100.00% <100.00%> (ø)
zeroconf/_handlers.py 98.87% <0.00%> (-1.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e60e13...583c068. Read the comment docs.

- The hash was being recalculated every time the object
  was being used in a set or dict. Since the hashes are
  effectively immutable, we only calculate them once now.
@bdraco bdraco merged commit d4c109c into python-zeroconf:master Aug 15, 2021
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.

Cache the result of DNS* __hash__

2 participants