mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +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:
parent
6976104a36
commit
589ecda56e
2 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -18,6 +18,10 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- 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.
|
||||
|
||||
- Issue #19506: Use a memoryview to avoid a data copy when piping data
|
||||
to stdin within subprocess.Popen.communicate. 5-10% less cpu usage.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue