Slower HTTP2 #1667
Replies: 1 comment 1 reply
-
So, HTTP/2 isn't "faster" than HTTP/1.1. In fact, because it's computationally more complex, it's possible that in some cases with a compute-is-relatively-slow language like Python, then part of the request/response handling will be slower. (although typically, the network dominates over any compute aspects.) HTTP/2 tends to be better for high concurrency, due to not having to re-establish multiple connections for each outgoing request. At some point it'd be helpful for our docs to reach into example real-world cases, to help illuminate when HTTP/2 is and isn't likely to be beneficial. If you could show exactly what you're doing, in a simple reproducible example, then we could look into it in more detail. |
Beta Was this translation helpful? Give feedback.
-
I did some benchmarking on http1.1/http2, the code is as simple as repeating a Google search request with httpx client(sync version) many times. The result is interesting: the http2 version is slower considerably (1.3 times).
Can someone explain why this happens?
Beta Was this translation helpful? Give feedback.
All reactions