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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EC64F158008 for ; Tue, 13 Jun 2023 06:47:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D7492E08B1; Tue, 13 Jun 2023 06:47:47 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9D9F3E089D for ; Tue, 13 Jun 2023 06:47:47 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 0/7] pypi.eclass: performance optimizations Date: Tue, 13 Jun 2023 08:45:00 +0200 Message-ID: <20230613064742.413335-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.41.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 253f7ef6-0e1c-4469-91e1-cf42b1441bc7 X-Archives-Hash: 96e48dd971ad2cb756220e1ab42368b2 Hi, Here's a set of patches that improve performance of pypi.eclass by eliminating the subshells from the most common code paths. It comes with a trivial benchmarking tool that shows roughly 16 times speedup from the changes. Thanks to Sam for bringing the problem up, and to Eli Schwartz for the shopt idea, that is responsible the final big speedup. -- Best regards, Michał Górny Michał Górny (7): pypi.eclass: Move setting globals to a function eclass/tests: Add pypi-bench.sh for global scope logic pypi.eclass: Translate version once in the default scenario pypi.eclass: Normalize names without subshell pypi.eclass: Translate version without subshell in common case pypi.eclass: Replace pypi_sdist_url in global scope pypi.eclass: Avoid subshell for extglob setting eclass/pypi.eclass | 128 ++++++++++++++++++++++++++----------- eclass/tests/pypi-bench.sh | 23 +++++++ 2 files changed, 113 insertions(+), 38 deletions(-) create mode 100755 eclass/tests/pypi-bench.sh -- 2.41.0