uvicorn
uvicorn copied to clipboard
Support zerocopy send
- [x] Implement with httptools.
- [x] Implement with h11: https://h11.readthedocs.io/en/latest/api.html#sendfile
Close #35
Hi @abersheeran I've invited you as a member of the Encode org. 👍
Hi @abersheeran I've invited you as a member of the Encode org. 👍
😀Yeah, I joined.
Hi @abersheeran I've invited you as a member of the Encode org. +1
I was about to ask that. :+1: Thanks!
Do we know what the deal is with the hanging CI tests?
It should be related with this branch. The CI is fine on uvicorn now.
The sendfile cannot be implemented on Windows, so the test coverage cannot reach 95%. I am not familiar with whether it can be selectively skipped in this case?
The sendfile cannot be implemented on Windows, so the test coverage cannot reach 95%. I am not familiar with whether it can be selectively skipped in this case?
Yeah, we were adding pragma: no cover
on non Python 3.8, as discussed here and the comment below.
But I wish we could do this: https://github.com/encode/uvicorn/pull/1159 - More context on the mentioned PRs there.
The sendfile cannot be implemented on Windows, so the test coverage cannot reach 95%. I am not familiar with whether it can be selectively skipped in this case?
Yeah, we were adding
pragma: no cover
on non Python 3.8, as discussed here and the comment below. But I wish we could do this: #1159 - More context on the mentioned PRs there.
Thanks for your reply, it is very helpful!
Thank you for your pr! Now hypercorn supports zerocopysend too.
Okay, so this is clearly a neatly done little bit of work, nonetheless I feel like I ought to be the voice of pushback here.
Personally I think that in the trade-off between functionality vs. increased complexity, increased ongoing maintenance cost, scope for bug introduction, this is a possibly poor trade-off for us.
I'd perhaps be more comfortable with this if it was obvious that it didn't affect any other behaviour other that just for that one message case, but currently the write buffer change makes me uncomfortable, as does the largish footprint of the change within the # Sending response body
block.
I'd perhaps be more comfortable with this if it was obvious that it didn't affect any other behaviour other that just for that one message case, but currently the write buffer change makes me uncomfortable, as does the largish footprint of the change within the
# Sending response body
block.
Sendfile has to face the buffer, there seems to be no good way to avoid interference with other types of responses-we have no means to predict this behavior before zerocopysend is sent.
Closing this as stale.