]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-41002: Optimize HTTPResponse.read with a given amount (GH-20943)
authorBruce Merry <bmerry@ska.ac.za>
Thu, 25 Jun 2020 06:30:21 +0000 (08:30 +0200)
committerGitHub <noreply@github.com>
Thu, 25 Jun 2020 06:30:21 +0000 (23:30 -0700)
commit152f0b8beea12e6282d284100b600771b968927a
treebe477e3f5f3886186aff7d183d21772beb8b607b
parentcf18c9e9d4d44f6671a3fe6011bb53d8ee9bd92b
bpo-41002: Optimize HTTPResponse.read with a given amount (GH-20943)

I've done the implementation for both non-chunked and chunked reads. I haven't benchmarked chunked reads because I don't currently have a convenient way to generate a high-bandwidth chunked stream, but I don't see any reason that it shouldn't enjoy the same benefits that the non-chunked case does. I've used the benchmark attached to the bpo bug to verify that performance now matches the unsized read case.

Automerge-Triggered-By: @methane
Lib/http/client.py
Lib/test/test_httplib.py
Misc/NEWS.d/next/Library/2020-06-17-17-26-24.bpo-41002.NPBItE.rst [new file with mode: 0644]