]> git.ipfire.org Git - thirdparty/httpx.git/commit
Change LineDecoder to match stdlib splitlines, resulting in significant speed up...
authorGianni Tedesco <gianni@scaramanga.co.uk>
Thu, 16 Mar 2023 14:29:15 +0000 (23:29 +0900)
committerGitHub <noreply@github.com>
Thu, 16 Mar 2023 14:29:15 +0000 (14:29 +0000)
commit85c5898d8e48011ab7b660fe8aac58910e45c84b
tree75423ad8ce4bfa1f8d5ac875582445ebdeb2791a
parente486fbceea7a933baa4b52852681f9c6ac80ac96
Change LineDecoder to match stdlib splitlines, resulting in significant speed up (#2423)

* Replace quadratic algo in LineDecoder

Leading to enormous speedups when doing things such as
Response(...).iter_lines() as described on issue #2422

* Update httpx/_decoders.py

* Update _decoders.py

Handle text ending in `\r` more gracefully.
Return as much content as possible.

* Update test_decoders.py

* Update _decoders.py

* Update _decoders.py

* Update _decoders.py

* Update httpx/_decoders.py

Co-authored-by: cdeler <serj.krotov@gmail.com>
* Update _decoders.py

---------

Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: cdeler <serj.krotov@gmail.com>
httpx/_decoders.py
tests/models/test_responses.py
tests/test_decoders.py