From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id uGKxKeki/mTX1gAAG6o9tA:P1 (envelope-from ) for ; Sun, 10 Sep 2023 22:11:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uGKxKeki/mTX1gAAG6o9tA (envelope-from ) for ; Sun, 10 Sep 2023 22:11:21 +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 685F14B094 for ; Sun, 10 Sep 2023 22:11:21 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=TJaolcZQ; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694376681; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6cGJEchu8Ozkgc4220loVlhPJzJbXsW6nST188D27FU=; b=HxwTdzUEbvQPhvaRUt8vIy70iLq1/G74xeaDN1XYxsqtUjRsC5J76UzaILANYpynYwoYSl fW0lYX9JQsFu3svU1eoxdspjQtjul8jtatNG3AocndV/sf8S6OMixAzNDg2HoNadWnOQDL qlwXgPq55HJdbfbE1w7WfqVNWdrSl5x+p2kxobyMXZotWQ8EA3oE1YRx4WFRNMFGI8FWO1 cfWhqoqI4o/BwfXiRToC0Uw3N1i3MH9F8JExpdxU8QUEzsVToQmWwTiuPDYXWAY6VEGFjc WutKIhzTQC/23llGzVv13vZVIlGG3GP7APjnFvoNnvYDim1lAGGF6rKcyyjQCw== 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=TJaolcZQ; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694376681; a=rsa-sha256; cv=none; b=CqKVgBq8bqBfySoGcZYjbmOxJv8wYPZlU3Dh/GOdSRa2Iwu7AgjLdWr6znNvUZiKXmU+py xijy/iTugliO07EgMC3rdAVfpKmgH+NTOBaKXS6urw6TknQdIHsmC8J4Kpi3gipL2DKTj+ PJ0OaY8WhHdjKJwxSWna630UaGBcjey7uNeJ8L597oOk5hoPij7TBu3w37ia6t8ra0GJSs HUsp2n9LF5Gc+ZneUvWy87Sh3EWND/LwmvhGADyvZp7BAaN9w/61p8AbXpJPJ1uyC+1iHE lCeH1/w4EatkZJ8yMhHv3nMZ6fZ58wmceP4mzUzFwki0CRlH/UyvqtA3+FbHKA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfQlo-0006ZT-S0; Sun, 10 Sep 2023 16:11:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfQlm-0006Yz-K9 for bug-guix@gnu.org; Sun, 10 Sep 2023 16:10:58 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfQlm-0008Gv-C8 for bug-guix@gnu.org; Sun, 10 Sep 2023 16:10:58 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfQlp-0008Cb-Vi for bug-guix@gnu.org; Sun, 10 Sep 2023 16:11:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65787: time-machine is doing too much network requests Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 10 Sep 2023 20:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65787 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Simon Tournier Cc: 65787@debbugs.gnu.org Received: via spool by 65787-submit@debbugs.gnu.org id=B65787.169437665131511 (code B ref 65787); Sun, 10 Sep 2023 20:11:01 +0000 Received: (at 65787) by debbugs.gnu.org; 10 Sep 2023 20:10:51 +0000 Received: from localhost ([127.0.0.1]:51448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfQlf-0008CA-2k for submit@debbugs.gnu.org; Sun, 10 Sep 2023 16:10:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfQlc-0008Bw-F5 for 65787@debbugs.gnu.org; Sun, 10 Sep 2023 16:10:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfQlT-0008C8-HW; Sun, 10 Sep 2023 16:10:39 -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=6cGJEchu8Ozkgc4220loVlhPJzJbXsW6nST188D27FU=; b=TJaolcZQLathJBqhwaiA gbv22SBz6lFULy2uJvyVUgMQh7lfwFVBSX9UU5B2e3N6OnWf19ntBwQM6ltGNWpJXgUko/6ndSzSR nz6R5WeKeFGCeYsgTvMcvAO+aRaiuRRhNYrYCfPskxx4IFY/N31sff88Njgm53QGu0vbG2VuA85hR 8tYtN7TrNjVk1jHgWPBILkO4MZj6Vw5u9CJqGqjI0XCnDRfDP1Z1O6a3KsmHNPa0IXkzZ90Iob9l/ +mHM6fMRmWf4Fjq8VCpUhY2v+V5CH0ifGG4yRU4ZyV8b+i3igLXdacAsJK6D08/7eJ0Md+6i5dpWe rg3nPFIX8jygCw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87wmx3mfo5.fsf@gmail.com> Date: Sun, 10 Sep 2023 22:10:36 +0200 In-Reply-To: <87wmx3mfo5.fsf@gmail.com> (Simon Tournier's message of "Wed, 06 Sep 2023 18:26:18 +0200") Message-ID: <87zg1tvlfn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 685F14B094 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -3.17 X-Spam-Score: -3.17 X-TUID: PdKLpJC9BrcF Hello Simon, This is a long message; I agree with the intent (avoiding network traffic when the required commit is already in cache), but I=E2=80=99m not = sure about the analysis. It would probably be easier if you could come with an example where there=E2=80=99s Git-related network traffic where there shouldn=E2=80=99t. Let me give some perspective on what the code intends to do. =E2=80=98cached-channel-instance=E2=80=99 has 3 cases: 1. Obvious cache hit: This is when CHANNELS specifies the commit of each target channel (this happens for example when you type =E2=80=98g= uix time-machine -q --commit=3Da4c35c607cfd7d6b0bad90cfcc46188d489e1754) *and* the combination of channels is already in ~/.cache/guix/inferiors. This is the optimal case: the Git repo doesn=E2=80=99t even need to be opened. 2. Cache hit: CHANNELS are pinned, but refer to tags (like =E2=80=9Cv1.2.= 0=E2=80=9D) or short commit IDs (like =E2=80=9Ca4c35c6=E2=80=9D). In that case, =E2=80=98channel-full-commit=E2=80=99 opens the Git repo to resolve th= e identifier. After that, we go to case #1 or #4. 3. Cache hit: CHANNELS are not pinned=E2=80=94i.e., they refer to a branc= h, not a commit. In that case we first need to perform a =E2=80=98git fe= tch=E2=80=99 and then we go to #1 or #4. 4. Cache miss: =E2=80=98reference-available?=E2=80=99 returns #f for the = channel commits, we got through =E2=80=98remote-fetch=E2=80=99 followed by =E2=80=98build-derivations=E2=80=99. As with all caches, what matters is to make sure case #1 is processes as efficiently as possible. I believe it=E2=80=99s the case since the Git rep= o is not even opened. Of course it would be nice to speed up #2 and #3 too (as long as it=E2=80= =99s not at the expense of #1). Maybe this is the purpose of your message: reducing Git remote accesses in those cases? (Apologies, I just realized this might have been what you had in mind. :-)) Thanks, Ludo=E2=80=99.