From d1d7c6e5cafd433d2f2fd912af3ef0b9246463e1 Mon Sep 17 00:00:00 2001 From: florimondmanca Date: Wed, 5 Aug 2020 21:19:05 +0200 Subject: [PATCH 1/2] Improve performance when receiving large responses --- httpcore/_async/http11.py | 2 +- httpcore/_async/http2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/httpcore/_async/http11.py b/httpcore/_async/http11.py index e513cdd62..ef9c2bfa2 100644 --- a/httpcore/_async/http11.py +++ b/httpcore/_async/http11.py @@ -23,7 +23,7 @@ class AsyncHTTP11Connection(AsyncBaseHTTPConnection): - READ_NUM_BYTES = 4096 + READ_NUM_BYTES = 64 * 1024 def __init__( self, socket: AsyncSocketStream, ssl_context: SSLContext = None, diff --git a/httpcore/_async/http2.py b/httpcore/_async/http2.py index af5b9eed9..64721ba15 100644 --- a/httpcore/_async/http2.py +++ b/httpcore/_async/http2.py @@ -26,7 +26,7 @@ def get_reason_phrase(status_code: int) -> bytes: class AsyncHTTP2Connection(AsyncBaseHTTPConnection): - READ_NUM_BYTES = 4096 + READ_NUM_BYTES = 64 * 1024 CONFIG = H2Configuration(validate_inbound_headers=False) def __init__( From d0571098a804b937c98938de2ddff2f580c92446 Mon Sep 17 00:00:00 2001 From: florimondmanca Date: Wed, 5 Aug 2020 21:44:51 +0200 Subject: [PATCH 2/2] Unasync --- httpcore/_sync/http11.py | 2 +- httpcore/_sync/http2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/httpcore/_sync/http11.py b/httpcore/_sync/http11.py index 2235ad263..5b65f77b9 100644 --- a/httpcore/_sync/http11.py +++ b/httpcore/_sync/http11.py @@ -23,7 +23,7 @@ class SyncHTTP11Connection(SyncBaseHTTPConnection): - READ_NUM_BYTES = 4096 + READ_NUM_BYTES = 64 * 1024 def __init__( self, socket: SyncSocketStream, ssl_context: SSLContext = None, diff --git a/httpcore/_sync/http2.py b/httpcore/_sync/http2.py index fba668584..bc29ee191 100644 --- a/httpcore/_sync/http2.py +++ b/httpcore/_sync/http2.py @@ -26,7 +26,7 @@ def get_reason_phrase(status_code: int) -> bytes: class SyncHTTP2Connection(SyncBaseHTTPConnection): - READ_NUM_BYTES = 4096 + READ_NUM_BYTES = 64 * 1024 CONFIG = H2Configuration(validate_inbound_headers=False) def __init__(