[issue19929] subprocess: increase read buffer size

STINNER Victor report at bugs.python.org
Sun Dec 8 12:02:32 CET 2013


STINNER Victor added the comment:

Where is the buffer size? The hardcoded 4096 value in Popen._communicate()?
   data = os.read(key.fd, 4096)

I remember that I asked you where does 4096 come from when you patched subprocess to use selectors (#18923):
http://bugs.python.org/review/18923/#ps9827

Python 3.3 uses 1024 for its select.select() implementation, 4096 for its select.poll() implementation.

Since Popen.communicate() returns the whole content of the buffer, would it be safe to increase the buffer size? For example, use 4 GB as the buffer size? Should communicate() be "fair" between stdout and stderr?

To choose a new value, we need benchmark results on different OSes, at least Windows, Linux, FreeBSD (and maybe also Solaris) since these 3 OSes have a different kernel.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19929>
_______________________________________


More information about the Python-bugs-list mailing list