From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DCFB3138330 for ; Sun, 27 May 2018 04:10:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 95FF7E0907; Sun, 27 May 2018 04:10:18 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 66111E0907 for ; Sun, 27 May 2018 04:10:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5FFE8335CBC for ; Sun, 27 May 2018 04:10:16 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 83A0435 for ; Sun, 27 May 2018 04:10:05 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1527394130.a629f11a0fa140bfd85baeefaf99c5896f972acc.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/AbstractPollTask.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: a629f11a0fa140bfd85baeefaf99c5896f972acc X-VCS-Branch: master Date: Sun, 27 May 2018 04:10:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8fc1120b-e95a-43f8-b487-c01560f5981c X-Archives-Hash: 596f2b83ca795675013ca1f501c9ed01 commit: a629f11a0fa140bfd85baeefaf99c5896f972acc Author: Zac Medico gentoo org> AuthorDate: Sun May 27 04:05:27 2018 +0000 Commit: Zac Medico gentoo 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: