Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PR aio-libs#7797/27c308b1 backport][3.9] Fix increase in latency wit…
…h small messages from websocket compression changes (aio-libs#7799) **This is a backport of PR aio-libs#7797 as merged into master (27c308b).** <!-- Thank you for your contribution! --> Changes the threshold that is required to compress in the executor for websocket messages to 5KiB aio-libs#7223 changed the websocket implementation to compress messages > 1KiB in the executor. The threshold was a bit low which caused an increase in latency compressing messages as the overhead to use the executor can exceed the cost to compress tiny messages. When testing 3.9.0 with Home Assistant, we saw a 3 order of magnitude increase in executor usage which resulted in an overall increase in cpu time since all the tiny messages were being compressed in the executor. I could not find the motivation for choosing 1KiB in the original PR <!-- Outline any notable behaviour for the end users. --> <!-- Are there any issues opened that will be resolved by merging this change? --> - [x] I think the code is well written - [ ] Unit tests for the changes exist - [ ] Documentation reflects the changes - [ ] If you provide code modification, please add yourself to `CONTRIBUTORS.txt` * The format is <Name> <Surname>. * Please keep alphabetical order, the file is sorted by names. - [ ] Add a new news fragment into the `CHANGES` folder * name it `<issue_id>.<type>` for example (588.bugfix) * if you don't have an `issue_id` change it to the pr id after creating the pr * ensure type is one of the following: * `.feature`: Signifying a new feature. * `.bugfix`: Signifying a bug fix. * `.doc`: Signifying a documentation improvement. * `.removal`: Signifying a deprecation or removal of public API. * `.misc`: A ticket has been closed, but it is not of interest to users. * Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files." Co-authored-by: J. Nick Koston <[email protected]>
- Loading branch information