Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmarks for speedups #473

Merged
merged 8 commits into from
Jul 1, 2023
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jun 30, 2023

With [speedups], the protocol overhead is roughly an order of magnitude lower (benchmarks available in bench)

This benchmark is from an M2 Mac Pro laptop.

# python3 devtools/bench/benchmark.py
New parser, parsing 100000 messages took 0.6212750830018194 seconds
Old parser, parsing 100000 messages took 9.37843908299692 seconds

This benchmark is from a Home Assistant Yellow

# python3 devtools/bench/benchmark.py
New parser, parsing 100000 messages took 4.951006034010788 seconds
Old parser, parsing 100000 messages took 61.288317951984936 seconds

README.md Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (b83986b) 79.50% compared to head (ada9b4f) 79.50%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #473   +/-   ##
=======================================
  Coverage   79.50%   79.50%           
=======================================
  Files          26       26           
  Lines        1952     1952           
  Branches      598      598           
=======================================
  Hits         1552     1552           
  Misses        359      359           
  Partials       41       41           

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

Copy link
Member

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for the PR! Could you move this under devtools/ and add the notes to its README?

README.md Outdated Show resolved Hide resolved
bdraco and others added 2 commits June 30, 2023 12:03
README.md Outdated Show resolved Hide resolved
@bdraco
Copy link
Member Author

bdraco commented Jun 30, 2023

moved and adjusted readme

@rytilahti
Copy link
Member

Could you still adjust the README.md of the devtools dir (with the example you had earlier)?

@bdraco bdraco closed this Jun 30, 2023
@bdraco bdraco reopened this Jun 30, 2023
@bdraco
Copy link
Member Author

bdraco commented Jun 30, 2023

close reopen to restart CI

@rytilahti rytilahti merged commit fde156c into python-kasa:master Jul 1, 2023
@bdraco bdraco deleted the benchmarks branch July 2, 2023 00:02
sdb9696 added a commit to sdb9696/python-kasa that referenced this pull request Jul 5, 2023
* Add optional kasa-crypt dependency for speedups (python-kasa#464)

If installed, use the optimized protocol encryption procedures implemented as a C extension by kasa-crypt (https://pypi.org/project/kasa-crypt/

* Add fixture for KP405 Smart Dimmer Plug (python-kasa#470)

* Add files via upload

* Add to KP405 to dimmers, update README

---------

Co-authored-by: Teemu Rytilahti <[email protected]>

* Add benchmarks for speedups (python-kasa#473)

* Add benchmarks for speedups

* Update README.md

* Update README.md

Co-authored-by: Teemu R. <[email protected]>

* relo

* Update README.md

* document benchmark

* Update README.md

---------

Co-authored-by: Teemu R. <[email protected]>

* Release 0.5.2 (python-kasa#475)

Besides some small improvements, this release:
* Adds optional dependency for for `orjson` and `kasa-crypt` to speed-up protocol handling by an order of magnitude.
* Drops Python 3.7 support as it is no longer maintained.

[Full Changelog](python-kasa/python-kasa@0.5.1...0.5.2)

* Merge

---------

Co-authored-by: J. Nick Koston <[email protected]>
Co-authored-by: xinud190 <[email protected]>
Co-authored-by: Teemu Rytilahti <[email protected]>
sdb9696 added a commit to sdb9696/python-kasa that referenced this pull request Jul 5, 2023
* Initial commit

* Update tests and some structure

* Update tests and discovery single logic

* Add more discovery tests

* pre-commit poetry black formatting

* Dev1 (#1)

* Initial commit

* Update tests and some structure

* Update tests and discovery single logic

* Add more discovery tests

* pre-commit poetry black formatting

* Latest changes from upstream

* Update comments

* Add changes from upstream2 (#5)

* Add optional kasa-crypt dependency for speedups (python-kasa#464)

If installed, use the optimized protocol encryption procedures implemented as a C extension by kasa-crypt (https://pypi.org/project/kasa-crypt/

* Add fixture for KP405 Smart Dimmer Plug (python-kasa#470)

* Add files via upload

* Add to KP405 to dimmers, update README

---------

Co-authored-by: Teemu Rytilahti <[email protected]>

* Add benchmarks for speedups (python-kasa#473)

* Add benchmarks for speedups

* Update README.md

* Update README.md

Co-authored-by: Teemu R. <[email protected]>

* relo

* Update README.md

* document benchmark

* Update README.md

---------

Co-authored-by: Teemu R. <[email protected]>

* Release 0.5.2 (python-kasa#475)

Besides some small improvements, this release:
* Adds optional dependency for for `orjson` and `kasa-crypt` to speed-up protocol handling by an order of magnitude.
* Drops Python 3.7 support as it is no longer maintained.

[Full Changelog](python-kasa/python-kasa@0.5.1...0.5.2)

* Merge

---------

Co-authored-by: J. Nick Koston <[email protected]>
Co-authored-by: xinud190 <[email protected]>
Co-authored-by: Teemu Rytilahti <[email protected]>

* get changes from upstream

* Move unauthenticated logic out of unauthenticated device

---------

Co-authored-by: J. Nick Koston <[email protected]>
Co-authored-by: xinud190 <[email protected]>
Co-authored-by: Teemu Rytilahti <[email protected]>
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.

3 participants