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 CCE96158021 for ; Wed, 21 Dec 2022 01:28:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BDBA7E0970; Wed, 21 Dec 2022 01:28:12 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A442BE0970 for ; Wed, 21 Dec 2022 01:28:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AB885341692 for ; Wed, 21 Dec 2022 01:28:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 222C5785 for ; Wed, 21 Dec 2022 01:28:10 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1671586082.f05140beb2dd9a3577ff2042941cb3e4fbb1df31.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/dbapi/porttree.py X-VCS-Directories: lib/portage/dbapi/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: f05140beb2dd9a3577ff2042941cb3e4fbb1df31 X-VCS-Branch: master Date: Wed, 21 Dec 2022 01:28:10 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3129054f-33b5-4976-825b-f068f26ac28f X-Archives-Hash: 3b393b6ccf35ccb5af1848d64c263f85 commit: f05140beb2dd9a3577ff2042941cb3e4fbb1df31 Author: Sam James gentoo org> AuthorDate: Sat Dec 17 05:15:27 2022 +0000 Commit: Sam James gentoo org> CommitDate: Wed Dec 21 01:28:02 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f05140be porttree: skip metadata verification if repository is immutable (not volatile) With Python 3.11, I get: - ~232695 total syscalls before (38268 read calls) - ~203656 total syscalls after (27381 read calls) It's a cheap improvement for simply promising to not touch ebuilds in a repository. Bug: https://bugs.gentoo.org/528394 See: a72a01746638debe472496bd8fc661992a6ba08b See: 5c7bf4eb09f644813a6f017ffd91665664142560 Signed-off-by: Sam James gentoo.org> lib/portage/dbapi/porttree.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/portage/dbapi/porttree.py b/lib/portage/dbapi/porttree.py index 15e1fd6ff..448a7f300 100644 --- a/lib/portage/dbapi/porttree.py +++ b/lib/portage/dbapi/porttree.py @@ -614,7 +614,8 @@ class portdbapi(dbapi): if ro_auxdb is not None: auxdbs.append(ro_auxdb) auxdbs.append(self.auxdb[repo_path]) - eclass_db = self.repositories.get_repo_for_location(repo_path).eclass_db + repo = self.repositories.get_repo_for_location(repo_path) + eclass_db = repo.eclass_db for auxdb in auxdbs: try: @@ -637,7 +638,9 @@ class portdbapi(dbapi): # EAPI from _parse_eapi_ebuild_head, we disregard cache entries # for unsupported EAPIs. continue - if auxdb.validate_entry(metadata, ebuild_hash, eclass_db): + if not repo.volatile or auxdb.validate_entry( + metadata, ebuild_hash, eclass_db + ): break else: metadata = None