From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8PqSLEePlGJGYwEAbAwnHQ (envelope-from ) for ; Mon, 30 May 2022 11:32:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id IECbLEePlGL3rwAA9RJhRA (envelope-from ) for ; Mon, 30 May 2022 11:32:55 +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 4885246668 for ; Mon, 30 May 2022 11:32:55 +0200 (CEST) Received: from localhost ([::1]:33160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvble-0006ms-C1 for larch@yhetil.org; Mon, 30 May 2022 05:32:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvbkp-0006m5-5e for bug-guix@gnu.org; Mon, 30 May 2022 05:32:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvbko-0003ZR-Sx for bug-guix@gnu.org; Mon, 30 May 2022 05:32:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nvbko-0004NG-Q0 for bug-guix@gnu.org; Mon, 30 May 2022 05:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#55721: Low cache usage in the presence of grafts Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 30 May 2022 09:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55721 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 55721@debbugs.gnu.org Received: via spool by 55721-submit@debbugs.gnu.org id=B55721.165390311916797 (code B ref 55721); Mon, 30 May 2022 09:32:02 +0000 Received: (at 55721) by debbugs.gnu.org; 30 May 2022 09:31:59 +0000 Received: from localhost ([127.0.0.1]:42776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvbkl-0004Mq-4Z for submit@debbugs.gnu.org; Mon, 30 May 2022 05:31:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvbki-0004Md-GE for 55721@debbugs.gnu.org; Mon, 30 May 2022 05:31:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvbkd-0003Xd-8e for 55721@debbugs.gnu.org; Mon, 30 May 2022 05:31:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=k+4hzhz3PbnpiGf0fYDnKHjcwShTug2upnqbtswpSx0=; b=OFtxj11mqFOE4XYkilLY +UIwk682kclJhLGoRh6BgoH5cKRN3sF7ZayAGDZbjA6VIkTXD6+8DbjB8Gaqc4Pa+TILXg+CDxRst R9AlsOHubY3obx0yVu+cV0o2SHXItv/PeCudFT7qf1EuYspXZLAR/ancmPv7tNmTCfr3oKmGNUz8B u3oEK7qaI1AQWUJFWV718UvK5eYVxO4w9KqU2ZqdPaAmyQjc3V3se5WHojaZtIrkFsZ5pEwNq8KSW 1yPDQrNdflTysBzR0XoFmRcFSioo4K3QOB7Y1Ye7HOF9wd2TEnWX9nh/BBzV4tFYWZhA5vkEB84p2 17JcBq+qRD47cQ==; Received: from [193.50.110.143] (port=38260 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvbkc-0004UO-QJ for 55721@debbugs.gnu.org; Mon, 30 May 2022 05:31:51 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87y1yj5s1p.fsf@inria.fr> Date: Mon, 30 May 2022 11:31:47 +0200 In-Reply-To: <87y1yj5s1p.fsf@inria.fr> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 30 May 2022 10:43:46 +0200") Message-ID: <87pmjv5pto.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" 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=1653903175; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=k+4hzhz3PbnpiGf0fYDnKHjcwShTug2upnqbtswpSx0=; b=A7Q7NTNr2wVkJ/4vMHCXGaLnPtybmAPgMFAd4jGKrJjuLNuSOmPk4yzEUisVGw5zgXmsVf gBuP3V4KVDx5ZTWimYEMrdg7YDajMLYLAv2PNaKu9F/2zrpaVhNriknof4xdg5Yi8jf5GL KUpWr+MWX5frAxq6ihXwD4VjAtXkWRVpePS0aurzlQJnH2RaDBQ85ZW8Y9Lu9P949FSwRB qCGbtDumeFv4b+LBENOVBtbLBPoZTGugsw05gCYYugjfceETDyjkNlpBcRaT63FRKGSkzC rMpHGi9DZGBJmfwzbaj1EVwshPx/HLyfC7YQGkAGnt4q5nmog6TcSg0FscPS0A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653903175; a=rsa-sha256; cv=none; b=kkocgEuyahA6SzeKopj9JAGwmUYDuOZDorUanzAvLK68hTQfYm4EH4LpD09rP+BKDokFwD gzytdO4UzxAcErikk11/+aPoZJCpXEKiGQzq2831RGzlHHWlZy2Ip04yuEgFwvafTthfwS Vs2S47JP5byzYlQAfAPR3ybJ59fT0hlGTe4k3dfnQs6kMVi6ruh9YJrXHaigLDJbYKBYOl y7bNnomXrw0U4WmLr/cj3vFZOwmuDK1Jh+T6+a04C6KXj08+18FdLm0KxDhRPdr4TF+FLO jt0etdj9ICDDI+yH2dJX6sdkfBLGOJvZu8HJDcOqp9FGNLbAMCdVlsUshLKqng== 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=OFtxj11m; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=OFtxj11m; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4885246668 X-Spam-Score: -4.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9ybUty+G7GBU --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s skribis: > $ time GUIX_PROFILING=3D"rpc reference-cache derivation-graft-cache" ./pr= e-inst-env guix system vm gnu/system/examples/desktop.tmpl=20 > 0.2 MB will be downloaded > polkit-0.121 198KiB = 1.4MiB/s 00:00 [##################] 100.0% > /gnu/store/sk1571rnh5jl2ilp0v1k8bqwsdrngwxy-run-vm.sh > Reference Cache: > fresh caches: 8 > lookups: 77581 > hits: 52890 (68.2%) > cache size: 838 entries > Derivation graft cache: > fresh caches: 39 > lookups: 704635 > hits: 627819 (89.1%) > cache size: 2946 entries > Remote procedure call summary: 33071 RPCs > built-in-builders ... 1 > query-substitutable-path-infos ... 2 > build-things ... 2 > add-to-store/tree ... 56 > valid-path? ... 59 > add-to-store ... 373 > add-text-to-store ... 7887 > query-references ... 24691 > > real 5m6.727s > user 6m59.438s > sys 0m1.633s With this patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/store.scm b/guix/store.scm index efba07bdcd..88cab1bb6a 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -1337,7 +1337,12 @@ (define (build-accumulator expected-store) (if (and (eq? (store-connection-socket store) (store-connection-socket expected-store)) (= mode (build-mode normal))) - (unresolved things continue) + (unresolved things + (lambda (new-store value) + ;; Borrow caches from NEW-STORE. + (set-store-connection-caches! + store (store-connection-caches new-store)) + (continue value))) (continue #t)))) (define default-cutoff @@ -1397,7 +1402,8 @@ (define-values (result rest) (if (unresolved? obj) ;; Pass #f because 'build-things' is now ;; unnecessary. - ((unresolved-continuation obj) #f) + ((unresolved-continuation obj) + store #f) obj)) result #:cutoff cutoff) (map/accumulate-builds store proc rest #:cutoff cutoff))))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E2=80=A6 we=E2=80=99re doing better: --8<---------------cut here---------------start------------->8--- $ guix gc -D $(guix build polkit --no-grafts) finding garbage collector roots... [0 MiB] deleting '/gnu/store/8vsfk8312m5p461wl4dq5lxjagfbwfhz-polkit-0.121' deleting `/gnu/store/trash' deleting unused links... note: currently hard linking saves 72397.13 MiB $ time GUIX_PROFILING=3D"rpc reference-cache derivation-graft-cache" ./pre-= inst-env guix system vm gnu/system/examples/desktop.tmpl=20 0.2 MB will be downloaded polkit-0.121 198KiB = 1.6MiB/s 00:00 [##################] 100.0% /gnu/store/wp3lv4xrh6vw79gnkyi5471c1l8j624n-run-vm.sh Reference Cache: fresh caches: 8 lookups: 17232 hits: 14816 (86.0%) cache size: 784 entries Derivation graft cache: fresh caches: 39 lookups: 128402 hits: 111336 (86.7%) cache size: 328 entries Remote procedure call summary: 10796 RPCs built-in-builders ... 1 query-substitutable-path-infos ... 2 build-things ... 2 add-to-store/tree ... 56 valid-path? ... 59 add-to-store ... 373 query-references ... 2416 add-text-to-store ... 7887 real 1m31.550s user 2m7.107s sys 0m0.637s --8<---------------cut here---------------end--------------->8--- There=E2=80=99s still room for improvement though. Ludo=E2=80=99. --=-=-=--