* Optimizing profile creation
@ 2013-09-02 21:14 Ludovic Courtès
2013-09-03 15:51 ` Andreas Enge
0 siblings, 1 reply; 2+ messages in thread
From: Ludovic Courtès @ 2013-09-02 21:14 UTC (permalink / raw)
To: guix-devel
At the GHM, Andreas rightfully noted that building a profile with many
files, as is the case when TeX Live is installed, can take quite a bit
of time; and every time a package is installed/removed/upgraded, you pay
that price again since the profile is built from scratch.
Creating a profile builds a symlink forest that is the union of all the
package directories that make up the profile. But with a package like
TeX Live, until now, this would end up traversing all of its ‘texmf’
sub-directory, just to create a symlink forest that copies the ‘texmf’
directory structure.
So, commit 43dd920 does the (now obvious) optimization: if a
sub-directory, like ‘texmf’, is only in one package, then it symlinks
that directory without traversing it.
This happens to be a quite frequent situation. For instance, with Emacs
in my profile, I would before have this:
--8<---------------cut here---------------start------------->8---
$ ls -l /nix/var/nix/profiles/per-user/ludo/guix-profile-104-link/share/emacs/
total 16
dr-xr-xr-x 6 root nixbld 4096 Jan 1 1970 24.3/
dr-xr-xr-x 3 root nixbld 12288 Jan 1 1970 site-lisp/
$ ls -l /nix/var/nix/profiles/per-user/ludo/guix-profile-104-link/share/emacs/24.3/lisp/
total 2096
lrwxrwxrwx 1 nixbld1 nixbld 87 Jan 1 1970 abbrev.elc -> /nix/store/f3pxa96mg8ws4kfldzarayd8i58ddz5j-emacs-24.3/share/emacs/24.3/lisp/abbrev.elc
lrwxrwxrwx 1 nixbld1 nixbld 89 Jan 1 1970 abbrev.el.gz -> /nix/store/f3pxa96mg8ws4kfldzarayd8i58ddz5j-emacs-24.3/share/emacs/24.3/lisp/abbrev.el.gz
lrwxrwxrwx 1 nixbld1 nixbld 86 Jan 1 1970 align.elc -> /nix/store/f3pxa96mg8ws4kfldzarayd8i58ddz5j-emacs-24.3/share/emacs/24.3/lisp/align.elc
lrwxrwxrwx 1 nixbld1 nixbld 88 Jan 1 1970 align.el.gz -> /nix/store/f3pxa96mg8ws4kfldzarayd8i58ddz5j-emacs-24.3/share/emacs/24.3/lisp/align.el.gz
[...]
--8<---------------cut here---------------end--------------->8---
With this optimization, I have directly this:
--8<---------------cut here---------------start------------->8---
$ ls -l /nix/var/nix/profiles/per-user/ludo/guix-profile-105-link/share/emacs/
total 16
lrwxrwxrwx 1 nixbld1 nixbld 71 Jan 1 1970 24.3 -> /nix/store/f3pxa96mg8ws4kfldzarayd8i58ddz5j-emacs-24.3/share/emacs/24.3/
dr-xr-xr-x 2 root nixbld 12288 Jan 1 1970 site-lisp/
--8<---------------cut here---------------end--------------->8---
No need to traverse the crowded ‘24.3’ directory since there’s only one
package in my profile that provides it.
Please report any speedups or bugs you may have. :-)
Ludo’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-03 15:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-02 21:14 Optimizing profile creation Ludovic Courtès
2013-09-03 15:51 ` Andreas Enge
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.