-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use loop.sendfile() instead of custom implementation if available #4517
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4517 +/- ##
==========================================
- Coverage 97.6% 97.59% -0.01%
==========================================
Files 43 43
Lines 8899 8907 +8
Branches 1402 1403 +1
==========================================
+ Hits 8686 8693 +7
- Misses 94 95 +1
Partials 119 119
Continue to review full report at Codecov.
|
…le (#4517) (cherry picked from commit e6f04ce) Co-authored-by: Andrew Svetlov <[email protected]>
…le (#4517) (#4518) (cherry picked from commit e6f04ce) Co-authored-by: Andrew Svetlov <[email protected]>
@@ -94,12 +95,25 @@ def _done_fut(self, out_fd: int, fut: 'asyncio.Future[None]') -> None: | |||
|
|||
async def sendfile(self) -> None: | |||
assert self.transport is not None | |||
loop = self.loop | |||
data = b''.join(self._sendfile_buffer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the use of memoryview()
be faster in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt that the speed difference is visible at all.
You can measure it if you want.
Fix #4269