commit: a629f11a0fa140bfd85baeefaf99c5896f972acc Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Sun May 27 04:05:27 2018 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sun May 27 04:08:50 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a629f11a
AbstractPollTask._read_array: document performance A benchmark that copies bytes from /dev/zero to /dev/null shows that arrays give a 15% performance improvement for Python 2.7.14. However, arrays significantly *decrease* performance for Python 3. Also, remove obsolete documentation about the POLLIN bit. pym/_emerge/AbstractPollTask.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py index f898aa708..4157794c6 100644 --- a/pym/_emerge/AbstractPollTask.py +++ b/pym/_emerge/AbstractPollTask.py @@ -25,15 +25,9 @@ class AbstractPollTask(AsynchronousTask): because it has bugs in all known versions of Python (including Python 2.7 and Python 3.2). See PipeReaderArrayTestCase. - | POLLIN | RETURN - | BIT | VALUE - | --------------------------------------------------- - | 1 | Read self._bufsize into an instance of - | | array.array('B') and return it, handling - | | EOFError and IOError. An empty array - | | indicates EOF. - | --------------------------------------------------- - | 0 | None + A benchmark that copies bytes from /dev/zero to /dev/null shows + that arrays give a 15% performance improvement for Python 2.7.14. + However, arrays significantly *decrease* performance for Python 3. """ buf = array.array('B') try: