Jc2k / aiohomekit

asyncio for homekit
Apache License 2.0
52 stars 20 forks source link

Reduce memory churn and copy while decoding large payload #307

Closed bdraco closed 1 year ago

bdraco commented 1 year ago

I was testing with some cameras and noticed the image encryption overhead was showing up in the profile

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 52.83% and project coverage change: -0.10 :warning:

Comparison is base (0607871) 67.54% compared to head (ae2950d) 67.45%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #307 +/- ## ========================================== - Coverage 67.54% 67.45% -0.10% ========================================== Files 72 72 Lines 6816 6821 +5 ========================================== - Hits 4604 4601 -3 - Misses 2212 2220 +8 ``` | [Impacted Files](https://app.codecov.io/gh/Jc2k/aiohomekit/pull/307?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [aiohomekit/controller/ble/pairing.py](https://app.codecov.io/gh/Jc2k/aiohomekit/pull/307?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YWlvaG9tZWtpdC9jb250cm9sbGVyL2JsZS9wYWlyaW5nLnB5) | `22.49% <ø> (ø)` | | | [aiohomekit/controller/ble/client.py](https://app.codecov.io/gh/Jc2k/aiohomekit/pull/307?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YWlvaG9tZWtpdC9jb250cm9sbGVyL2JsZS9jbGllbnQucHk=) | `29.91% <4.76%> (-2.80%)` | :arrow_down: | | [aiohomekit/controller/ble/key.py](https://app.codecov.io/gh/Jc2k/aiohomekit/pull/307?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YWlvaG9tZWtpdC9jb250cm9sbGVyL2JsZS9rZXkucHk=) | `50.00% <50.00%> (+7.69%)` | :arrow_up: | | [aiohomekit/controller/ip/connection.py](https://app.codecov.io/gh/Jc2k/aiohomekit/pull/307?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YWlvaG9tZWtpdC9jb250cm9sbGVyL2lwL2Nvbm5lY3Rpb24ucHk=) | `81.25% <86.66%> (-0.37%)` | :arrow_down: | | [aiohomekit/crypto/\_\_init\_\_.py](https://app.codecov.io/gh/Jc2k/aiohomekit/pull/307?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YWlvaG9tZWtpdC9jcnlwdG8vX19pbml0X18ucHk=) | `100.00% <100.00%> (ø)` | | | [aiohomekit/crypto/chacha20poly1305.py](https://app.codecov.io/gh/Jc2k/aiohomekit/pull/307?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YWlvaG9tZWtpdC9jcnlwdG8vY2hhY2hhMjBwb2x5MTMwNS5weQ==) | `69.04% <100.00%> (-1.41%)` | :arrow_down: | | [aiohomekit/protocol/\_\_init\_\_.py](https://app.codecov.io/gh/Jc2k/aiohomekit/pull/307?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YWlvaG9tZWtpdC9wcm90b2NvbC9fX2luaXRfXy5weQ==) | `61.95% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

bdraco commented 1 year ago

I thought it was caused by this PR, but pressing identify on the eve energy causes a disconnect

Happens on main as well

bdraco commented 1 year ago

problem was with the esp32 but this code

bdraco commented 1 year ago

coap uses cryptography directly so no changes there

Jc2k commented 1 year ago

😍 for getting rid of that return false.

bdraco commented 1 year ago

thanks