From: Ricardo Wurmus <rekado@elephly.net>
To: guix-devel@gnu.org
Subject: Speed up grafts by storing reference offset in index
Date: Fri, 13 Dec 2024 13:50:27 +0100 [thread overview]
Message-ID: <87o71frbl8.fsf@elephly.net> (raw)
Hello Guix,
grafts can be a little slow for a number of reasons:
- they are not substituted, because the assumption is that it is
preferrable to rewrite references locally instead of downloading a big
archive with the modified file. Local computations on x86_64 are
often acceptable, but on aarch64 systems they can be very slow indeed.
- when a lot of grafts need to be applied, many files need to be
rewritten
- big files take longer to read and thus to rewrite
Since it is December and I'm in a silly mood here is a silly idea: would
it make sense to shift parts of the grafting work to an offloadable
build? Here's what I imagine:
- on the build farms build an additional derivation for a references
file. The references file is an S-expression containing a list of
tuples of the form (FILE-NAME OFFSET). Each of these tuples
identifies the location of a single reference at the recorded byte
OFFSET in FILE-NAME.
- when computing grafts, don't search the local files sequentially for
references but look them up in the references file. Instead of
computing the reference file substitute it from a build server.
Alternatively, change the format for substitutes and record reference
locations there, so that the local store database can also store
reference locations. It already stores references (for things like
"guix gc -R"), so maybe we could store just a little extra information
to allow us to seek to the offset directly.
As you can tell, I haven't thought this through, and there are a number
of different places where a feature like this could live.
What do you think?
--
Ricardo
next reply other threads:[~2024-12-13 12:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-13 12:50 Ricardo Wurmus [this message]
2024-12-15 0:10 ` Speed up grafts by storing reference offset in index Ludovic Courtès
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=87o71frbl8.fsf@elephly.net \
--to=rekado@elephly.net \
--cc=guix-devel@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.