Creating new httpx.AsyncClient takes too long #3545
Unanswered
chmielcode
asked this question in
Ideas
Replies: 1 comment
-
|
For now I create a global default ssl context and pass it as verify argument wherever I create a new client or transport. Maybe this will help someone else having the same problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
httpx version:
0.28.1
Current Behavior:
Creating new httpx.AsyncClient takes 0.2-1.0s depending on hardware
Expected Behavior:
Creating new httpx.AsyncClient takes 0.0s when rounded
Steps To Reproduce:
import httpx
httpx.AsyncClient()
Description:

I've narrowed it down to httpx.AsyncHTTPTransport instantiation and create_ssl_context function.
The slow part is:
Would it be possible to cache the "default case" and reuse it? I'm using a library that requires new AsyncClient instance for each session and the delay is really noticeable.
Beta Was this translation helpful? Give feedback.
All reactions