test(bench): cover _uint16/_uint32_int_as_uuid and short_address#270
Merged
bdraco merged 1 commit intoMay 21, 2026
Merged
Conversation
Adds direct codspeed + pytest-benchmark coverage for three hot-path helpers that previously only had indirect coverage via the gap parse benchmarks: - _uint16_int_as_uuid (per-16-bit-UUID lookup in service_uuids loop) - _uint32_int_as_uuid (per-32-bit-UUID lookup, also used by 32-bit service data) - short_address (called from human_readable_name and by external callers; dash-input is benchmarked separately to baseline the replace+split path) Test-only; no behaviour change.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #270 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 266 266
Branches 42 42
=========================================
Hits 266 266 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
Performance Changes
Comparing |
bdraco
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Direct codspeed + pytest-benchmark coverage for three hot-path helpers in
gap.py/utils.pythat previously only had indirect coverage via the parse-advertisement benchmarks._uint16_int_as_uuid— looked up per 16-bit UUID inside the service-UUID list loop and fromTYPE_SERVICE_DATA._uint32_int_as_uuid— same role for 32-bit UUIDs (alsoTYPE_SERVICE_DATA_32BIT_UUID).short_address— used byhuman_readable_nameand by external callers; benchmarked for both:and-separators (dash always goes through thereplace+splitpath).Why
The 16/32-bit converters changed call shape in #251 (int-keyed instead of bytes-keyed) and the 128-bit sibling got a fresh benchmark in #267. The remaining two converters and
short_addresshad no direct baseline, so any future change would lack a regression signal.How
Pattern matches
test_mac_to_int.py/test_int_to_bluetooth_address.py: one codspeed file undertests/benchmarks/and a parallelbench/mirror without the type annotation (per the convention noted in #258).Testing
pytest tests/benchmarks/test_uint16_int_as_uuid.py tests/benchmarks/test_uint32_int_as_uuid.py tests/benchmarks/test_short_address.py --codspeed— 4 benchmarks, all green.pytest bench/test_uint16_int_as_uuid.py bench/test_uint32_int_as_uuid.py bench/test_short_address.py— 4 benchmarks, all green.ruff check tests/benchmarks/ bench/— clean.Test-only; no behaviour change.
Quality Report
Changes: 6 files changed, 44 insertions(+)
Code scan: clean
Tests: failed (FAILED)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline