feat: speed up parsing incoming records by bdraco · Pull Request #1458 · python-zeroconf/python-zeroconf

@bdraco

Most of the time parsing incoming records is spent in object creation. We can use cython's fast new path, and than use cdefs to create them which avoids all the type conversions.

@codspeed-hq

CodSpeed Performance Report

Merging #1458 will improve performances by 44.47%

Comparing fast_new (bee7a74) with master (9f6af54)

Summary

⚡ 1 improvements
✅ 2 untouched benchmarks

Benchmarks breakdown

Benchmark master fast_new Change
test_parse_incoming_message 326.6 µs 226.1 µs +44.47%

@bdraco bdraco marked this pull request as ready for review

January 6, 2025 21:31

@codecov

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.75%. Comparing base (9f6af54) to head (bee7a74).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1458   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files          30       30           
  Lines        3252     3283   +31     
  Branches      446      446           
=======================================
+ Hits         3244     3275   +31     
  Misses          6        6           
  Partials        2        2           

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