Title: test: add codspeed benchmarks for listener duplicate-packet dedup by bluetoothbot · Pull Request #1744 · python-zeroconf/python-zeroconf · GitHub
Open Graph Title: test: add codspeed benchmarks for listener duplicate-packet dedup by bluetoothbot · Pull Request #1744 · python-zeroconf/python-zeroconf
X Title: test: add codspeed benchmarks for listener duplicate-packet dedup by bluetoothbot · Pull Request #1744 · python-zeroconf/python-zeroconf
Description: What Three CodSpeed benchmarks for AsyncListener._process_datagram_at_time, exercising the duplicate-packet suppression branch under different stream shapes. Why #1743 replaces the single-slot remembered-last-packet dedup (self.data) with a bounded recency window keyed on payload bytes. Landing benchmarks ahead of that change lets CodSpeed compare before/after on the same PR — so we can demonstrate the alternating-flood improvement does not come at the cost of regressing the steady-state hit or unique-stream paths. Verified on master: test_alternating_payloads: 200/200 packets bypass dedup (the bug from #1724). test_dedup_hit_same_payload: 1/200 reach parse (steady-state dedup works). After #1743 lands, CodSpeed should show a large speedup on the alternating case and roughly flat results on the other two. How tests/benchmarks/test_listener_dedup.py — three @pytest.mark.asyncio benchmarks following the test_send.py pattern (AsyncZeroconf on loopback, async_close in teardown so the project-wide verify_threads_ended fixture stays green). _InertListener subclasses AsyncListener and stubs handle_query_or_defer, holding the post-dedup work constant across implementations so any delta is attributable to the dedup branch itself. Toggles registry.has_entries = True directly instead of round-tripping async_register_service through the event loop — the realistic code path stays live without paying registration cost in setup. 200 packets per benchmark iteration; queries (_FLAGS_QR_QUERY) without QU questions so the dedup branch is eligible. Testing SKIP_CYTHON=1 poetry run pytest tests/benchmarks/test_listener_dedup.py --no-cov # 3 passed poetry run ruff check tests/benchmarks/test_listener_dedup.py poetry run ruff format --check tests/benchmarks/test_listener_dedup.py Behavioural check on master (instrumented handle_query_or_defer count): alternating: 200/200 packets parse same payload: 1/200 packets parse Quality Report Changes: 1 file changed, 128 insertions(+) Code scan: clean Tests: passed (4 PASSED) Branch hygiene: clean Generated by Kōan post-mission quality pipeline
Open Graph Description: What Three CodSpeed benchmarks for AsyncListener._process_datagram_at_time, exercising the duplicate-packet suppression branch under different stream shapes. Why #1743 replaces the single-slot reme...
X Description: What Three CodSpeed benchmarks for AsyncListener._process_datagram_at_time, exercising the duplicate-packet suppression branch under different stream shapes. Why #1743 replaces the single-slot reme...
Opengraph URL: https://github.com/python-zeroconf/python-zeroconf/pull/1744
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f903f227-1503-df78-4629-9b42bdba67e3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E2A4:15252C:386FD8:4BF648:6B008A11 |
| html-safe-nonce | 6f24af7ec71c00b4be623bd7d8f5c945187a4c08ee9c117fc4de4bc0e358cddb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkE0OjE1MjUyQzozODZGRDg6NEJGNjQ4OjZCMDA4QTExIiwidmlzaXRvcl9pZCI6IjE2NjQ2NjUwMDg1ODk1Mzk4NTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2f4bf8841e7c5b69044253719c6ac39c5572425e1827c0a58f545e787d2289ad |
| hovercard-subject-tag | pull_request:3713181858 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-zeroconf/python-zeroconf/pull/1744/files |
| twitter:image | https://avatars.githubusercontent.com/u/284751220?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/284751220?s=400&v=4 |
| og:image:alt | What Three CodSpeed benchmarks for AsyncListener._process_datagram_at_time, exercising the duplicate-packet suppression branch under different stream shapes. Why #1743 replaces the single-slot reme... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4d3d8e50f02c1d7bf86d5acfa1d3bfe9366abd6528a6b429eb07a168429d2b61 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python-zeroconf/python-zeroconf git https://github.com/python-zeroconf/python-zeroconf.git |
| octolytics-dimension-user_id | 120192235 |
| octolytics-dimension-user_login | python-zeroconf |
| octolytics-dimension-repository_id | 21548731 |
| octolytics-dimension-repository_nwo | python-zeroconf/python-zeroconf |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21548731 |
| octolytics-dimension-repository_network_root_nwo | python-zeroconf/python-zeroconf |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | db758f8e02b8257935fb03edf81a3e76eb3abd11 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width