Skip to content

feat: add parse_advertisement_data_bytes method#121

Merged
bdraco merged 18 commits into
mainfrom
parse_advertisement_data_bytes
Apr 27, 2025
Merged

feat: add parse_advertisement_data_bytes method#121
bdraco merged 18 commits into
mainfrom
parse_advertisement_data_bytes

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Mar 14, 2025

Note that this will make parse_advertisement_data a bit slower, but nothing uses that anymore in the HA bluetooth stack and its only there for backwards compatibility to avoid a breaking change.

I wasn't originally planning to move this PR forward for the 2us performance benefit, but now that we need it to solve home-assistant/core#143769 (comment) it makes sense to do so

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 14, 2025

Codecov Report

❌ Patch coverage is 98.64865% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.59%. Comparing base (c51e7ab) to head (31407d6).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
src/bluetooth_data_tools/gap.py 98.64% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main     #121      +/-   ##
===========================================
- Coverage   100.00%   99.59%   -0.41%     
===========================================
  Files            6        6              
  Lines          226      245      +19     
  Branches        27       32       +5     
===========================================
+ Hits           226      244      +18     
- Partials         0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 14, 2025

CodSpeed Performance Report

Merging #121 will degrade performances by 30.48%

Comparing parse_advertisement_data_bytes (31407d6) with main (c51e7ab)

Summary

❌ 1 regressions
✅ 4 untouched benchmarks
🆕 4 new benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_parse_advertisement_data 24.3 µs 35 µs -30.48%
🆕 test_parse_advertisement_data_tuple N/A 34.6 µs N/A
🆕 test_parse_advertisement_single_tuple N/A 17.9 µs N/A
🆕 test_parse_advertisement_data_bytes N/A 16.2 µs N/A
🆕 test_parse_advertisement_data_tuple_bytes N/A 76.3 µs N/A

@bdraco
Copy link
Copy Markdown
Member Author

bdraco commented Mar 14, 2025

savings potential is 2us....not so worth it

@bdraco bdraco closed this Mar 14, 2025
@bdraco bdraco reopened this Apr 27, 2025
@bdraco bdraco marked this pull request as ready for review April 27, 2025 20:18
@bdraco bdraco merged commit ce07c1c into main Apr 27, 2025
33 of 36 checks passed
@bdraco bdraco deleted the parse_advertisement_data_bytes branch April 27, 2025 20:20
bluetoothbot added a commit to bluetoothbot/bluetooth-data-tools that referenced this pull request May 20, 2026
The pytest-benchmark suite under bench/ — which feeds the CI step summary
via --benchmark-autosave — drifted out of sync with the codspeed suite
under tests/benchmarks/ when Bluetooth-Devices#237 added native mac_to_int and Bluetooth-Devices#121 added
parse_advertisement_data_bytes. Both functions are present in the codspeed
runs but missing from the GitHub Actions step-summary comparison, so
regressions in those paths don't show up in the human-readable CI report.

Mirror the codspeed tests into bench/ using the local style (no
BenchmarkFixture import, no type annotations) so the step summary covers
both fast paths.
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.

1 participant