micropython/extmod/uasyncio
Thorsten von Eicken c21452a1d2 extmod/uasyncio: Attempt to write immediately in Stream.write method.
The main aim of this change is to reduce the number of heap allocations
when writing data to a stream.  This is done in two ways:

1. Eliminate appending of data when .write() is called multiple times
   before calling .drain().  With this commit, the data is written out
   immediately if the underlying stream is not blocked, so there is no
   accumulation of the data in a temporary buffer.

2. Eliminate copying of non-bytes objects passed to .write().  Prior to
   this commit, passing a bytearray or memoryview to .write() would always
   result in a copy of it being made and turned into a bytes object.  That
   won't happen now if the underlying stream is not blocked.

Also, this change makes .write () more closely implement the CPython
documented semantics: "The method attempts to write the data to the
underlying socket immediately.  If that fails, the data is queued in an
internal write buffer until it can be sent."
2022-06-24 17:00:24 +10:00
..
__init__.py extmod/uasyncio: Add ThreadSafeFlag. 2021-02-16 16:35:37 +11:00
core.py extmod/uasyncio: Rename and merge TaskQueue push/pop methods. 2022-04-22 16:37:02 +10:00
event.py extmod/uasyncio: Rename and merge TaskQueue push/pop methods. 2022-04-22 16:37:02 +10:00
funcs.py extmod/uasyncio: Fix edge case for cancellation of wait_for. 2022-06-02 17:14:20 +10:00
lock.py extmod/uasyncio: Rename and merge TaskQueue push/pop methods. 2022-04-22 16:37:02 +10:00
manifest.py extmod/uasyncio: Add manifest.py for freezing uasyncio Py files. 2020-03-26 01:25:45 +11:00
stream.py extmod/uasyncio: Attempt to write immediately in Stream.write method. 2022-06-24 17:00:24 +10:00
task.py extmod/uasyncio: Rename and merge TaskQueue push/pop methods. 2022-04-22 16:37:02 +10:00