async-pep
async-pep copied to clipboard
Scatter/gather IO API doesn't make sense yet
Firstly, write_sequence currently mostly takes a list of bytes buffers. Much like writeSequence, this doesn't usually lead to any real performance gain. In order for it to actually work, you'd need iovec support, which as far as we know isn't in Python yet, or at least not in the stdlib.
Secondly, write_sequence
only covers the gather half of scatter/gather. There would still need to be a data_vector_received
or something for covering scatter.
There is apparently a related thing called memoryview
, but supposedly that's unfinished and deeply broken.
(Reported by JP.)
Can't this be implemented in the adapter layer? Feed it too much data to .write() and let it optimise this away?