Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve performance of creating the ConnectionKey
Reuses the same idea as aio-libs/yarl#1316 and aio-libs/yarl#1322 Calling `tuple.__new__` is much faster because it avoids the extra runtime lambda having to be run and arguments unpacked for every message https://github.com/python/cpython/blob/d83fcf8371f2f33c7797bc8f5423a8bca8c46e5c/Lib/collections/__init__.py#L441 This only works if the object being created is a `NamedTuple` so this speed up is only recommended internally and should not be used outside of `aiohttp` since we do not guarantee that ConnectionKey will remain a `NamedTuple` in the future.
- Loading branch information