From patchwork Fri May 13 14:59:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 763 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 65DAA27BBE9; Fri, 13 May 2022 16:00:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 271AF27BBEA for ; Fri, 13 May 2022 16:00:13 +0100 (BST) Received: from localhost ([::1]:38540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npWm4-0000WA-8I for patchwork@mira.cbaines.net; Fri, 13 May 2022 11:00:12 -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 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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