_close_expire_connections is unexpectedly expensive with tls connections
#893
Replies: 1 comment
|
This specific hot path has changed since the profile in the report. Current sock = self._stream.extra(anyio.abc.SocketAttribute.raw_socket, None)
return is_socket_readable(sock)Likewise, SSL object/address/socket queries each request only their corresponding typed AnyIO attribute. That is the right shape for this call site because So before optimizing In other words, the reported diagnosis appears to have been addressed at the backend abstraction level; the useful next step is a current-version profile to see whether there is a second bottleneck underneath it. |
Uh oh!
There was an error while loading. Please reload this page.
It looks like the cause is calling into anyio
get_extra_infobecause this function does a lot of work under the hood https://github.com/agronholm/anyio/blob/e0529a31e819064fcf1eaf7df55d1712a30bed6b/src/anyio/streams/tls.py#L230All that httpcore wants is
is_readablehttpcore/httpcore/_async/http11.py
Line 290 in 5518172
All reactions