lvh / async-pep

Draft PEP for asynchronous IO
ISC License
62 stars 7 forks source link

Scatter/gather IO API doesn't make sense yet #6

Open lvh opened 13 years ago

lvh commented 13 years ago

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.)

jerub commented 13 years ago

Can't this be implemented in the adapter layer? Feed it too much data to .write() and let it optimise this away?