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 78D9B1396D9 for ; Tue, 21 Nov 2017 19:27:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C32B2E0F25; Tue, 21 Nov 2017 19:27:58 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 A3F70E0F25 for ; Tue, 21 Nov 2017 19:27:58 +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 619DC340806 for ; Tue, 21 Nov 2017 19:27:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D57B0A2D0 for ; Tue, 21 Nov 2017 19:27:55 +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: <1511292437.ca300d4fccffb8cd3d0d12f60c7c8c368f049258.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dbapi/bintree.py X-VCS-Directories: pym/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: ca300d4fccffb8cd3d0d12f60c7c8c368f049258 X-VCS-Branch: master Date: Tue, 21 Nov 2017 19:27:55 +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: 722f38d7-45ac-4552-824c-6cec5b347180 X-Archives-Hash: 879554a709dd6b5d65da27fcf4941ffa commit: ca300d4fccffb8cd3d0d12f60c7c8c368f049258 Author: Zac Medico gentoo org> AuthorDate: Tue Nov 21 19:22:21 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Nov 21 19:27:17 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ca300d4f binarytree.populate: avoid unnecessary index re-write (bug 638292) Exclude hashes from the minimum_keys, so that the Packages index will not be needlessly re-written due to missing digests. Bug: https://bugs.gentoo.org/638292 pym/portage/dbapi/bintree.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index f4e8a1c66..201666c41 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -569,6 +569,11 @@ class binarytree(object): def _populate_local(self): self.dbapi.clear() _instance_key = self.dbapi._instance_key + # In order to minimize disk I/O, we never compute digests here. + # Therefore we exclude hashes from the minimum_keys, so that + # the Packages file will not be needlessly re-written due to + # missing digests. + minimum_keys = self._pkgindex_keys.difference(self._pkgindex_hashes) if True: pkg_paths = {} self._pkg_paths = pkg_paths @@ -631,7 +636,7 @@ class binarytree(object): continue except (KeyError, ValueError): continue - if not self._pkgindex_keys.difference(d): + if not minimum_keys.difference(d): match = d break if match: