summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2013-12-08 18:56:07 (GMT)
committerGregory P. Smith <greg@krypto.org>2013-12-08 18:56:07 (GMT)
commit589ecda56eb23937ba871734598cda8f11395389 (patch)
treeeca06a8daf598b2ef14f7f8a8b4f1a100b1f213c /Lib/subprocess.py
parent6976104a36aa426bcf23b2e4b7e7a706f25beeeb (diff)
downloadcpython-589ecda56eb23937ba871734598cda8f11395389.zip
cpython-589ecda56eb23937ba871734598cda8f11395389.tar.gz
cpython-589ecda56eb23937ba871734598cda8f11395389.tar.bz2
Fixes issue #19929: Call os.read with 32768 within subprocess.Popen
communicate rather than 4096 for efficiency. A microbenchmark shows Linux and OS X both using ~50% less cpu time this way.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 546a7a0..78e4fcf 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1654,7 +1654,7 @@ class Popen(object):
if self._input_offset >= len(self._input):
close_unregister_and_remove(fd)
elif mode & select_POLLIN_POLLPRI:
- data = os.read(fd, 4096)
+ data = os.read(fd, 32768)
if not data:
close_unregister_and_remove(fd)
self._fd2output[fd].append(data)