unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: 65787@debbugs.gnu.org
Subject: bug#65787: time-machine is doing too much network requests
Date: Sun, 10 Sep 2023 22:10:36 +0200	[thread overview]
Message-ID: <87zg1tvlfn.fsf@gnu.org> (raw)
In-Reply-To: <87wmx3mfo5.fsf@gmail.com> (Simon Tournier's message of "Wed, 06 Sep 2023 18:26:18 +0200")

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’m not sure
about the analysis.  It would probably be easier if you could come with
an example where there’s Git-related network traffic where there
shouldn’t.

Let me give some perspective on what the code intends to do.

‘cached-channel-instance’ 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 ‘guix
     time-machine -q --commit=a4c35c607cfd7d6b0bad90cfcc46188d489e1754)
     *and* the combination of channels is already in
     ~/.cache/guix/inferiors.  This is the optimal case: the Git repo
     doesn’t even need to be opened.

  2. Cache hit: CHANNELS are pinned, but refer to tags (like “v1.2.0”)
     or short commit IDs (like “a4c35c6”).  In that case,
     ‘channel-full-commit’ opens the Git repo to resolve the identifier.
     After that, we go to case #1 or #4.

  3. Cache hit: CHANNELS are not pinned—i.e., they refer to a branch,
     not a commit.  In that case we first need to perform a ‘git fetch’
     and then we go to #1 or #4.

  4. Cache miss: ‘reference-available?’ returns #f for the channel
     commits, we got through ‘remote-fetch’ followed by
     ‘build-derivations’.

As with all caches, what matters is to make sure case #1 is processes as
efficiently as possible.  I believe it’s the case since the Git repo is
not even opened.

Of course it would be nice to speed up #2 and #3 too (as long as it’s
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’.




  reply	other threads:[~2023-09-10 20:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 16:26 bug#65787: time-machine is doing too much network requests Simon Tournier
2023-09-10 20:10 ` Ludovic Courtès [this message]
2023-09-11  9:41   ` Simon Tournier
2023-09-11 11:36     ` Simon Tournier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zg1tvlfn.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=65787@debbugs.gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).