django
django copied to clipboard
Fixed #33865 -- Optimized LimitedStream wrapper.
ticket-33865
See the ticket for benchmark scripts and output.
Basically this makes LimitedStream.read()
~1.25x faster and LimitedStream.readline()
~2x faster \o/
Thanks @apollo13. I'm away for a couple of weeks, so will get back to this then.
Rebased and marked ready for review again. See my comments above - I don't think we need to do anything further here but, if we do, it should be a separate ticket.
I'm pretty sure this is fine but, do we want to merge it after the feature freeze, so we get the whole 5.0 cycle for any issues to appear. (5.0 also isn't LTS so...)
Quick chat with @felixxm, let's have it this time.
@ngnpope Let me know on the other points and we'll push it forwards. Thanks!
Ok @carltongibson. Have updated following your review.
@ngnpope Thanks :+1: