mirror of
https://github.com/python/cpython.git
synced 2025-12-10 19:10:59 +00:00
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.
This commit is contained in:
commit
7b83b18679
2 changed files with 5 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue