[New-bugs-announce] [issue17655] Use writev() function in the io module

STINNER Victor report at bugs.python.org
Mon Apr 8 03:00:15 CEST 2013

New submission from STINNER Victor:

Since issue #12268 has been fixed, it looks like it became easier to modify the io to use the writev() function when available.

For example, if FileIO.writelines() uses writev(), it can be used by TextIOWrapper.write() through BufferedWriter. The _io.TextIOWrapper.write() method stores encoded chunks of text into a list. It can calls buffer.writlines(pending) instead of buffer.write(b''.join(pending)).

I expect less Python function calls and less system calls, and so better performances because both are expensive (especially I/O syscalls).

See also issue #15723.

I don't know if/how readv() can be used to optimize I/O performances.

components: IO
messages: 186259
nosy: gregory.p.smith, haypo, pitrou
priority: normal
severity: normal
status: open
title: Use writev() function in the io module
type: performance
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list