Skip to content

Commit

Permalink
Implement zerocopy writes
Browse files Browse the repository at this point in the history
With Python 3.12+ and later transport.writelines is implemented as `sendmsg(..., IOV_MAX)`
which allows us to avoid joining the bytes and sending them in one go
  • Loading branch information
bdraco committed Nov 1, 2024
1 parent 658e13a commit 3cb5ec1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aioesphomeapi/_frame_helper/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def __init__(
self._loop = loop
self._connection = connection
self._transport: asyncio.Transport | None = None
self._writelines: None | (Callable[[bytes | bytearray | memoryview], None]) = (
None
)
self._writelines: (
None | (Callable[[Iterable[bytes | bytearray | memoryview[int]]], None])
) = None
self.ready_future = self._loop.create_future()
self._buffer: bytes | None = None
self._buffer_len = 0
Expand Down

0 comments on commit 3cb5ec1

Please sign in to comment.