From: "Ludovic Courtès" <ludo@gnu.org>
To: 45102@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#45102] [PATCH 0/4] Making fewer 'stat' calls during startup
Date: Mon, 7 Dec 2020 16:21:59 +0100 [thread overview]
Message-ID: <20201207152159.28551-1-ludo@gnu.org> (raw)
Hi Guix!
On Guix System, with 6 entries in $GUILE_LOAD_PATH (which should just
be 2 entries, one for /run/current-system and one for ~/.guix-profile),
I see this:
--8<---------------cut here---------------start------------->8---
$ strace -c -e stat,openat guix
guix: mankas komanda nomo
Provu 'guix --help' por pli da informo.
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
90.94 0.002207 0 2283 2057 stat
9.06 0.000220 0 334 177 openat
------ ----------- ----------- --------- --------- ----------------
100.00 0.002427 0 2617 2234 total
--8<---------------cut here---------------end--------------->8---
This is a lot of ‘stat’ calls for nothing, 4 times more than when
GUILE_LOAD_PATH is unset:
--8<---------------cut here---------------start------------->8---
$ env -i $(type -P strace) -c -e stat,openat $(type -P guix)
guix: missing command name
Try `guix --help' for more information.
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
57.89 0.000187 0 495 272 stat
42.11 0.000136 0 321 175 openat
------ ----------- ----------- --------- --------- ----------------
100.00 0.000323 0 816 447 total
--8<---------------cut here---------------end--------------->8---
This patch series takes a sledgehammer approach to always have as
few ‘stat’ calls as possible during startup. After the change, I get:
--8<---------------cut here---------------start------------->8---
$ strace -e stat,openat -c /gnu/store/g9gylj723si8i2cp8ia57a7kr4i8b1m9-guix-20201207.14/bin/guix
guix: mankas komanda nomo
Provu 'guix --help' por pli da informo.
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
60.53 0.000322 0 454 231 stat
39.47 0.000210 0 334 177 openat
------ ----------- ----------- --------- --------- ----------------
100.00 0.000532 0 788 408 total
$ env -i $(type -P strace) -e stat,openat -c /gnu/store/g9gylj723si8i2cp8ia57a7kr4i8b1m9-guix-20201207.14/bin/guix
guix: missing command name
Try `guix --help' for more information.
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
69.92 0.000272 0 442 219 stat
30.08 0.000117 0 321 175 openat
------ ----------- ----------- --------- --------- ----------------
100.00 0.000389 0 763 394 total
--8<---------------cut here---------------end--------------->8---
What impact does it have on startup time? Hard to tell.
On my 4-year old x86_64 laptop with an SSD, it seems to be negligible,
even on a cold cache. I suspect things are different on spinning
disks and on NFS.
The semantic difference should be invisible to users: their modules
are still visible and usable in manifests, in ‘guix repl’, etc.; they
just cannot take precedence over modules from Guile and from the
channels. For instance, one cannot define a (gnu packages base)
module or (ice-9 rdelim), drop it in $GUILE_LOAD_PATH, and have that
module picked up in lieu of the original one. I think that’s a
reasonable tradeoff.
Thoughts?
Ludo’.
Ludovic Courtès (4):
build: 'script/guix' uses our own 'guile' executable.
self: Move Guile early in the module search path.
guix: 'guile' executable ignores GUILE_LOAD_PATH during startup.
self: Remove the empty string from '%load-extensions'.
Makefile.am | 1 +
gnu/packages/aux-files/guile-launcher.c | 46 +++++++++++++++++++++++--
guix/self.scm | 26 +++++++++-----
scripts/guix.in | 2 +-
4 files changed, 63 insertions(+), 12 deletions(-)
--
2.29.2
next reply other threads:[~2020-12-07 15:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-07 15:21 Ludovic Courtès [this message]
2020-12-07 15:29 ` [bug#45102] [PATCH 1/4] build: 'script/guix' uses our own 'guile' executable Ludovic Courtès
2020-12-07 15:29 ` [bug#45102] [PATCH 2/4] self: Move Guile early in the module search path Ludovic Courtès
2020-12-07 15:29 ` [bug#45102] [PATCH 3/4] guix: 'guile' executable ignores GUILE_LOAD_PATH during startup Ludovic Courtès
2020-12-07 15:29 ` [bug#45102] [PATCH 4/4] self: Remove the empty string from '%load-extensions' Ludovic Courtès
2020-12-08 13:50 ` [bug#45102] [PATCH 0/4] Making fewer 'stat' calls during startup Mathieu Othacehe
2020-12-08 20:24 ` Ludovic Courtès
2020-12-11 18:12 ` bug#45102: " 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=20201207152159.28551-1-ludo@gnu.org \
--to=ludo@gnu.org \
--cc=45102@debbugs.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.