6606.1 requests/sec 6579.0 requests/sec 6566.2 requests/sec 6613.8 requests/sec 6599.3 requests/sec 6609.9 requests/sec 6499.8 requests/sec
6236.0 requests/sec 6307.3 requests/sec 6508.0 requests/sec 6534.3 requests/sec 6448.1 requests/sec 6493.6 requests/sec 6482.0 requests/sec
So you're totally right; the issue is in this function: https://github.com/python-hyper/h11/blob/master/h11/_readers.py#L35
Thank you for advice about the desired spot, I feel so stupid!
_obsolete_line_fold a bit:
def _obsolete_line_fold(lines): it = iter(lines) last = None for line in it: match = obs_fold_re.match(line) if match: if last is None: raise LocalProtocolError("continuation line at start of headers") if not isinstance(last, bytearray): last = bytearray(last) while last.endswith(b"\r"): # change is here del last[-1] # and there last += b" " last += line[match.end() :] else: if last is not None: yield last last = line if last is not None: while last.endswith(b"\r"): # change is here del last[-1] # and there yield last
I assume that if
assert isinstance(last, bytearray), then we can just remove the end of the bytearray (please correct me if I'm wrong, but it shouldn't cause an extra alloc).
\rin the middle of a header value
\rfrom the end of header values, and that's also handled by the regexp changes :-)
if line[-1] == b"\r": del line[-1]at the top of the
rstripby avoiding the copy)
lines = out.split(b"\n") for line in lines: if line[-1] == b"\r": del line[-1]
bench.py results are the same.
6444.4 requests/sec 6271.3 requests/sec 6463.9 requests/sec 6517.6 requests/sec 6467.8 requests/sec 6484.8 requests/sec 6461.5 requests/sec
del line[-1] version
6477.9 requests/sec 6495.6 requests/sec 6508.1 requests/sec 6474.8 requests/sec 6473.1 requests/sec 6513.7 requests/sec 6504.7 requests/sec
I'm sorry that I again disturb you, but please could you answer?
What can we do to merge and release python-hyper/h11#115 ?
I don't want to be so irritating , just wonder if I can help somehow
I would like to accept python-hyper/h11#117 and more generally setup flake8 linting with the same settings in all the projects (probably https://gitlab.com/pgjones/quart/-/blob/master/tox.ini#L32 which I use in most places).
I'll take apathy as approval :), but would value any suggestions.
Happy New Year everyone!
Do you know whenever it's possible to release
h11? Having released
h11, we can create a NewYear gift to the
axis community (https://github.com/home-assistant/core/issues/42415#issuecomment-752667227)