New submission from STINNER Victor:

The following code copies data, whereas the copy can be avoided using a memory 
view:

chunk = self._input[self._input_offset:self._input_offset + _PIPE_BUF]
self._input_offset += os.write(key.fd, chunk)

It should be replaced with:

input_view = memoryview(self._input)
...
chunk = input_view[self._input_offset:self._input_offset + _PIPE_BUF]
self._input_offset += os.write(key.fd, chunk)


This issue is a reminder for one of my comment of issue #18923.

----------
messages: 202240
nosy: haypo, neologix
priority: normal
severity: normal
status: open
title: subprocess.communicate() should use a memoryview
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19506>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to