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

DNM: Improve performance of starting client responses #10036

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,8 @@ async def start(self, connection: "Connection") -> "ClientResponse":
headers=exc.headers,
) from exc

if message.code < 100 or message.code > 199 or message.code == 101:
code = message.code
if code < 100 or code > 199 or code == 101:
break

if self._continue is not None:
Expand All @@ -1002,14 +1003,10 @@ async def start(self, connection: "Connection") -> "ClientResponse":
# payload eof handler
payload.on_eof(self._response_eof)

# response status
self.version = message.version
self.status = message.code
self.reason = message.reason

# headers
self._headers = message.headers # type is CIMultiDictProxy
self._raw_headers = message.raw_headers # type is Tuple[bytes, bytes]
# unpack message
self.version, self.status, self.reason, self._headers, self._raw_headers, *_ = (
message
)

# payload
self.content = payload
Expand Down
Loading