• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jstasiak / python-zeroconf / 561
94%

Build:
DEFAULT BRANCH: master
Ran 07 Mar 2020 09:34PM UTC
Jobs 6
Files 2
Run time 6min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
561

push

travis-ci

jstasiak
Optimize handle_response cache check

The handle_response loop would encounter a unique record
it would search the cache in order to remove keys that
matched the DNSEntry for the record.

Since the cache is stored as a list of records with the key as the record name,
 we can avoid searching the entire cache each time and on
search for the DNSEntry of the record. In practice this means
with 5000 entries and records in the cache we now only need to search
4 or 5.

When looping over the cache entries for the name, we now check the expire time
first as its cheaper than calling DNSEntry.__eq__

Test environment:

  Home Assistant running on home networking with a /22
  and a significant amount of broadcast traffic

  Testing was done with py-spy v0.3.3
    (https://github.com/benfred/py-spy/releases)

  # py-spy top --pid <pid>

Before:
```
Collecting samples from '/usr/local/bin/python3 -m homeassistant --config /config' (python v3.7.6)
Total Samples 10200
GIL: 0.00%, Active: 0.00%, Threads: 35

  %Own   %Total  OwnTime  TotalTime  Function (filename:line)
  0.00%   0.00%   18.13s    18.13s   _worker (concurrent/futures/thread.py:78)
  0.00%   0.00%    2.51s     2.56s   run (zeroconf/__init__.py:1221)
  0.00%   0.00%   0.420s    0.420s   __eq__ (zeroconf/__init__.py:394)
  0.00%   0.00%   0.390s    0.390s   handle_read (zeroconf/__init__.py:1260)
  0.00%   0.00%   0.240s    0.670s   handle_response (zeroconf/__init__.py:2452)
  0.00%   0.00%   0.230s    0.230s   __eq__ (zeroconf/__init__.py:606)
  0.00%   0.00%   0.200s    0.810s   handle_response (zeroconf/__init__.py:2449)
  0.00%   0.00%   0.140s    0.150s   __eq__ (zeroconf/__init__.py:632)
  0.00%   0.00%   0.130s    0.130s   entries (zeroconf/__init__.py:1185)
  0.00%   0.00%   0.090s    0.090s   notify (threading.py:352)
  0.00%   0.00%   0.080s    0.080s   read_utf (zeroconf/__init__.py:818)
  0.00%   0.00%   0.080s    0.080s   __eq__ (zeroconf/__init__.py:678)
  0.00%   0.00%   0.070s    0.080s  ... (continued)

2091 of 2234 relevant lines covered (93.6%)

5.62 hits per line

Jobs
ID Job ID Ran Files Coverage
1 561.1 07 Mar 2020 09:35PM UTC 0
93.66
Travis Job 561.1
2 561.2 07 Mar 2020 09:34PM UTC 0
93.66
Travis Job 561.2
3 561.3 07 Mar 2020 09:34PM UTC 0
93.57
Travis Job 561.3
4 561.4 07 Mar 2020 09:35PM UTC 0
93.58
Travis Job 561.4
5 561.5 07 Mar 2020 09:40PM UTC 0
93.74
Travis Job 561.5
6 561.6 07 Mar 2020 09:37PM UTC 0
93.28
Travis Job 561.6
Source Files on build 561
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #561
  • 37fa0a0d on github
  • Prev Build on master (#551)
  • Next Build on master (#566)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc