diff options
author | Gregory P. Smith <greg@krypto.org> | 2013-12-08 18:58:28 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2013-12-08 18:58:28 (GMT) |
commit | 7b83b186794cec6e5d12f43f9c1a6f20bfa4e932 (patch) | |
tree | 646ac8ddc323f12a3c621d3afd4ace73e893e2cd /Lib/subprocess.py | |
parent | bd6932a576e643c8aad8c0b4a044655882ebb27d (diff) | |
parent | 589ecda56eb23937ba871734598cda8f11395389 (diff) | |
download | cpython-7b83b186794cec6e5d12f43f9c1a6f20bfa4e932.zip cpython-7b83b186794cec6e5d12f43f9c1a6f20bfa4e932.tar.gz cpython-7b83b186794cec6e5d12f43f9c1a6f20bfa4e932.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.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index e7f39fe..e79e5fd 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1601,7 +1601,7 @@ class Popen(object): selector.unregister(key.fileobj) key.fileobj.close() elif key.fileobj in (self.stdout, self.stderr): - data = os.read(key.fd, 4096) + data = os.read(key.fd, 32768) if not data: selector.unregister(key.fileobj) key.fileobj.close() |