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
Speed up websocket and ingress with aiohttp-zlib-ng #103247
Conversation
https://github.com/bdraco/aiohttp-zlib-ng https://github.com/pycompression/python-zlib-ng zlib-ng was choosen because: - Its at the point where cloudflare is using it in production - Its a drop-in replacement for zlib with no code changes needed - Fedora is talking about making it the default zlib implementation https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/CDNPJ4SOTRQMYVCDI3ZSY4SP4FYESCWD/ - well maintained https://github.com/zlib-ng/zlib-ng/releases - It has significant performance improvements over stock zlib https://www.phoronix.com/news/Zlib-ng-2.1-Beta Other alternatives (https://bugs.python.org/issue41566) where not choosen because: python-isal: https://github.com/pycompression/python-isal: not widely compatible, not a drop-in replacement libdeflate: no stream implementation, not a drop-in replacement
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
anything that is added as a dep to http needs to be a core dep because its too late to import it otherwise
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this in my local dev environment and prod environment with addons, everything works fine. No visible break in ingress or websocket while using. Ingress felt more responsive, but haven't measured this.
Thanks for testing 👍 |
Pushed to a few more production systems. All good |
mysql test failure is unrelated. still don't know why that times out. |
This change is probably cause of this regression, where the Core fails to start completely on CPUs that don't support some modern instruction sets used by our zlib-ng build: #105254 |
Proposed change
https://github.com/bdraco/aiohttp-zlib-ng
https://github.com/pycompression/python-zlib-ng
zlib-ng was choosen because:
Other alternatives (https://bugs.python.org/issue41566) where not choosen because:
python-isal: https://github.com/pycompression/python-isal: not widely compatible, not a drop-in replacement
libdeflate: no stream implementation, not a drop-in replacement
wheels have built successfully: https://wheels.home-assistant.io/musllinux/
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: