Title: test: add benchmarks for cache mark-to-expire path (#1780) by bluetoothbot · Pull Request #1785 · python-zeroconf/python-zeroconf · GitHub
Open Graph Title: test: add benchmarks for cache mark-to-expire path (#1780) by bluetoothbot · Pull Request #1785 · python-zeroconf/python-zeroconf
X Title: test: add benchmarks for cache mark-to-expire path (#1780) by bluetoothbot · Pull Request #1785 · python-zeroconf/python-zeroconf
Description: What Three CodSpeed benchmarks covering DNSCache.async_mark_unique_records_older_than_1s_to_expire — the RFC 6762 §10.2 paragraph 2 path that today mutates cached DNSRecord instances in place via _async_set_created_ttl. Why Issue #1780 proposes switching from in-place mutation to copy-on-expire so listeners and ServiceInfo consumers that hold a reference to a cached record don't see its TTL/created flip out from under them mid-dispatch. The follow-up decision (fix vs. leave as-is) needs a baseline number for the current hot path — these benchmarks supply that. How test_mark_to_expire_1000_records_all_stale — every cached record triggers the mutate-and-re-add branch (worst case). test_mark_to_expire_1000_records_none_stale — fresh records, scan-only path; the delta to the all-stale case isolates the mutation cost. test_mark_to_expire_many_unique_types — 100 distinct (name, type, class) triplets, one stale record each — mirrors a burst response superseding many RRsets at once. No code changes outside tests/benchmarks/. Testing poetry run pytest tests/benchmarks/test_cache_mark_expire.py -v — 3 passed. Quality Report Changes: 1 file changed, 123 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 covering DNSCache.async_mark_unique_records_older_than_1s_to_expire — the RFC 6762 §10.2 paragraph 2 path that today mutates cached DNSRecord instances in place via _...
X Description: What Three CodSpeed benchmarks covering DNSCache.async_mark_unique_records_older_than_1s_to_expire — the RFC 6762 §10.2 paragraph 2 path that today mutates cached DNSRecord instances in place via _...
Opengraph URL: https://github.com/python-zeroconf/python-zeroconf/pull/1785
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:39d38817-9a13-ab1e-00e8-b53659f89834 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 89C8:2828AA:1561DA:1DB7E8:6B008313 |
| html-safe-nonce | 6871de822135b5037ca39f6cf2b3a896ae65309f8991797d6f5c4981f45a351e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUM4OjI4MjhBQToxNTYxREE6MURCN0U4OjZCMDA4MzEzIiwidmlzaXRvcl9pZCI6Ijg4NDQyNzM1NjM0MDI3OTc4NDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6c75b44331fd86181865bd5cda8af158911fb417c2e5d9fff426766ab613e738 |
| hovercard-subject-tag | pull_request:3749760351 |
| 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/1785/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 covering DNSCache.async_mark_unique_records_older_than_1s_to_expire — the RFC 6762 §10.2 paragraph 2 path that today mutates cached DNSRecord instances in place via _... |
| 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