From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0MGvMXtyfmKoRwEAbAwnHQ (envelope-from ) for ; Fri, 13 May 2022 17:00:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GKS4MHtyfmLn8gAAG6o9tA (envelope-from ) for ; Fri, 13 May 2022 17:00:11 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 26EBD3DCB7 for ; Fri, 13 May 2022 17:00:11 +0200 (CEST) Received: from localhost ([::1]:38540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npWm2-0000WA-08 for larch@yhetil.org; Fri, 13 May 2022 11:00:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npWlv-0000VW-Op for guix-patches@gnu.org; Fri, 13 May 2022 11:00:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npWlv-0000VA-Dh for guix-patches@gnu.org; Fri, 13 May 2022 11:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npWlv-00084E-BK for guix-patches@gnu.org; Fri, 13 May 2022 11:00:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55398] [PATCH 0/3] Improve store caching; improve 'map/accumulate-builds' performance Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 May 2022 15:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55398 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55398@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165245399830965 (code B ref -1); Fri, 13 May 2022 15:00:03 +0000 Received: (at submit) by debbugs.gnu.org; 13 May 2022 14:59:58 +0000 Received: from localhost ([127.0.0.1]:44519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npWlp-00083N-My for submit@debbugs.gnu.org; Fri, 13 May 2022 10:59:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:47606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npWln-00083F-Vr for submit@debbugs.gnu.org; Fri, 13 May 2022 10:59:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npWln-0000Tb-Ns for guix-patches@gnu.org; Fri, 13 May 2022 10:59:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34212) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npWln-0000NM-A2; Fri, 13 May 2022 10:59:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=sVpWpPSPLiNNg1U6tvP6nEFMs20+s4hKr6O/98nhAco=; b=VEKMDgfpW6Y0P7 fwpTaIzrPK+kMWMsSvWaaCJzx1qtE8bG5KCbYJBqTo50//5GQhzP6Sg37VrLsMDl7u9LdEN4qqwpn 4F6JdlpV4BElZN9fVL76wlbNOy1MlTpj5rZ02ShapwG3vNOav/12h9GD6bvcIoIKb9Xb4NvQfKEcD LF/qK2adkCSL1GoyxYpgo/YlefvCGe08Rh5dTBMSNlbE5DsXNZaJidZLX7xEXsVTnGnDZKTjiuNQT W2PuKEQvGSehs7/Lcx/fMUrMWx2sNCMMJ8hg8i1zwBO4OeASAJnyDTgyLBZtLElkxRq+uaJP7EJnu c0A6xTtMgE3V9VvL4V9A==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=44954 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npWlm-0008OV-6b; Fri, 13 May 2022 10:59:54 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 13 May 2022 16:59:47 +0200 Message-Id: <20220513145947.11951-1-ludo@gnu.org> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652454011; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=sVpWpPSPLiNNg1U6tvP6nEFMs20+s4hKr6O/98nhAco=; b=oShjCoPedRwuzC6uTHGTU/nDjm+0BBjLkcEN0CDp/gvhJiYbzgnQBa8ryVf1OZ1WrZzXud HR232gG8JapbsJk0iomRBsiDdBpmt7LA73mRAFn1IFju55He1TwizlQS/KPsHmDvU8AcIn LKH8/NGudYYhL3N9kODhYp/bgqJ/l7ySNIRfo2amKbQpd8cZpU2b5E/aGktiVrAgde+OaA d1NSG/DkHGb8MhlGK/TdSRqdOIqjo80MUNZBXef2hBcT+PY5BACqdcWxF6jv8uYowZGl/U FlW8HBx7IdV2tHdcQwSO+K4xGBoWWC/N4p/ywMRxhs77JJsG4ILTShTx+yZZZQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652454011; a=rsa-sha256; cv=none; b=ha+PnYfFbCZ68Fd9ntppVKX5k1raoCPEaR7u11Kkfi/4VaZhWPOILlXZTV8sJRsiFXATMZ 6n5FtQyKp4HliyZClGh0QQA1OSQPZj3FVqLjVHoD5DznLdXJp94orLIHJfPp2hL2tYsAS3 GTjEFrVyuImnIz1IeC0kaIxKeW0pU7iTtFP5dZmMQ5XEmE60nHf5P4C7FKadB+X1zExKWW 6huOVxReQXhgV6CbdU8NLjySSh9/hFVWXBRoZSmVnC7zUkZsjrLwVbZPKEzNQcvWWb7sFO S2ztdByOWMeF6avZS5xXFg0jLMyczF2qmfhg+2gALAI9DP+/y6V75nRil29rOA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VEKMDgfp; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VEKMDgfp; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 26EBD3DCB7 X-Spam-Score: -2.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: gyzeaugMUdRE Hello! The first patch improves cache handling, providing a generic way to trace caches. The second patch adds a separate package/graft cache, as was previously suggested in a comment. The cache hit rate can be seen by setting GUIX_PROFILING: --8<---------------cut here---------------start------------->8--- $ time GUIX_PROFILING=package-graft-cache ./pre-inst-env guix home build -v1 -n ~/src/configuration/home-config.scm 28.5 MB would be downloaded Package Graft Cache: fresh caches: 1 lookups: 794 hits: 784 (98.7%) cache size: 10 entries real 0m7.953s user 0m9.091s sys 0m0.291s --8<---------------cut here---------------end--------------->8--- The last patch improves performance in the presence of grafts by trimming exploration of the call tree in ‘map/accumulate-builds’. This is very much a heuristic, but it does help significantly for ‘guix system’, ‘guix home’, or ‘guix package’ with many packages. Thoughts? Ludo’. Ludovic Courtès (3): store: 'mcached' users can specify a cache ID. packages: Use separate package/graft cache. store: Use a decaying cutoff in 'map/accumulate-builds'. guix/packages.scm | 12 ++++-- guix/store.scm | 104 +++++++++++++++++++++++++++++++++------------- 2 files changed, 84 insertions(+), 32 deletions(-) base-commit: 0b4300d4fd8c972f0cb9d6751fc824b9a065b780 -- 2.36.0