From: Maxime Devos <maximedevos@telenet.be>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 50384@debbugs.gnu.org
Subject: [bug#50384] [PATCH v4] Optimise search-patch (reducing I/O)
Date: Thu, 23 Sep 2021 19:26:51 +0200 [thread overview]
Message-ID: <3563a99b37c8ef3b226b7fef25a5afa273c08b6e.camel@telenet.be> (raw)
In-Reply-To: <87r1dhj2bk.fsf_-_@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 3283 bytes --]
Ludovic Courtès schreef op di 21-09-2021 om 18:55 [+0200]:
> Hi!
>
> I took the liberty to reopen this patch because there were good ideas
> IMO. I’m sorry if my many questions and lack of responsiveness came out
> as a suggestion that this approach wasn’t good.
I reordered your mail a little.
> Looking at the big picture, what I’d like to have is a package
> derivation cache designed in such a way that “guix install foo” wouldn’t
> even need to load any package module on a cache hit. That’d make a
> noticeable difference performance-wise, that’s another level of
> complexity… (I have a rough design in mind that we could discuss.)
This ‘package derivation cache’ seems an interesting idea to pursue,
though I wonder what could be used as ‘keys’ in the derivation cache.
Package names aren't sufficient because packages can have multiple versions,
package names + package versions aren't sufficient because packages can have
multiple variants. Grafts might need some care. Having multiple versions of
guix can be addressed by including the commits of every channel in the key.
Even if ‘foo’ isn't in the cache, the cache can still be useful if the
inputs ‘bar’ and ‘baz’ of foo are in the cache.
> Ludovic Courtès <ludo@gnu.org> skribis:
>
> > > +;; repeated 'stat' calls. Allow computing the hash of the file in advance,
> > > +;; to avoid having to send the file to the daemon when it is already interned
> > > +;; in the store.
> > > (define-record-type <local-file>
> > > - (%%local-file file absolute name recursive? select?)
> > > + (%%local-file file absolute name sha256 recursive? select?)
> > > local-file?
> > > (file local-file-file) ;string
> > > (absolute %local-file-absolute-file-name) ;promise string
> > > (name local-file-name) ;string
> > > + (sha256 local-file-sha256) ;sha256 bytevector | #f
> >
> > Could we store the result of ‘fixed-output-path’ rather than the SHA256,
> > while we’re at it?
Embedding the result of ‘fixed-output-path’ in the .go might be problematic
from a closure size perspective, as that would create additional references in the
store items of guix.
> I tried that with the patch below, roughly taking the same approach as
> your patch series, but somewhat simplified, mostly so I could
> experiment. [...]
>
> We can estimate the performance of that strategy by commenting out the
> ‘add-temp-root*’ call (thus getting a single RPC) in
> ‘local-file-compiler’: this time it’s slightly faster, but we’re in the
> 1% range on the wall-clock time of ‘guix build pigx -d --no-grafts’:
> [...]
> Perhaps the gains would be a bit higher if we change all the package
> files to use ‘local-patches’, but we probably can’t expect a lot more
> anyway since that process is CPU-bound.
>
> So I don’t know. It feels like a worthy optimization, and one that’s
> manageable from a maintenance viewpoint, but it buys us very little.
>
> Thoughts?
As it is only <1%, I would prefer trying the ‘package derivation cache’
first, as it seems to have more potential.
> Ludo’.
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
next prev parent reply other threads:[~2021-09-23 17:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-04 21:17 [bug#50384] [PATCH] Optimise search-patch (reducing I/O) Maxime Devos
2021-09-04 21:47 ` Ludovic Courtès
2021-09-04 22:04 ` Ludovic Courtès
2021-09-05 19:48 ` [bug#50384] [PATCH v2] " Maxime Devos
2021-09-05 22:40 ` Maxime Devos
2021-09-06 8:39 ` zimoun
2021-09-06 10:06 ` Maxime Devos
2021-09-09 14:51 ` [bug#50384] [PATCH] " Ludovic Courtès
2021-09-21 16:55 ` [bug#50384] [PATCH v4] " Ludovic Courtès
2021-09-23 17:26 ` Maxime Devos [this message]
2021-09-27 16:17 ` Ludovic Courtès
2021-10-04 16:46 ` [bug#50384] [PATCH] " zimoun
2021-10-08 7:41 ` Ludovic Courtès
2021-10-11 8:09 ` [bug#39258] bug#50384: " zimoun
2021-09-09 20:25 ` [bug#50384] [PATCH v3] " Maxime Devos
2021-09-10 9:54 ` bug#50384: " Maxime Devos
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3563a99b37c8ef3b226b7fef25a5afa273c08b6e.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=50384@debbugs.gnu.org \
--cc=ludo@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.