From: ludo@gnu.org (Ludovic Courtès)
To: Guix-devel <guix-devel@gnu.org>
Subject: guix size
Date: Thu, 18 Jun 2015 09:08:27 +0200 [thread overview]
Message-ID: <87egl9sdck.fsf@gnu.org> (raw)
Hello!
Commit fcc58db adds a new ‘guix size’ command (I’ve copied the
documentation below.)
I encourage you to give it a try, it’s quite insightful. For instance:
--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix size ardour
substitute: updating list of substitutes from 'http://hydra.gnu.org'... 100.0%
store item total self
/gnu/store/sykhf0d7ya15n1a96v6kra4x7qlv0q14-ardour-4.0 1901.6 73.3 3.9%
/gnu/store/2pxds860wayj2i5l8lamnbrmw95vq5df-suil-0.8.2 1558.5 0.1 0.0%
/gnu/store/c51q9ch9f8bpmp8xacsx3sjazhqj5m3n-qt-4.8.7 1152.5 150.2 7.9%
/gnu/store/474fjgir7pzs5d2i7djmxrbyq6l801bw-gtkmm-2.24.4 791.0 9.2 0.5%
/gnu/store/pbl6nlnfxc56qa36ssqig5rm8vqarqgq-gtk+-2.24.28 773.0 35.6 1.9%
/gnu/store/x7g63pla2bi0hahmg2ryvqvk3y5as2dc-cups-2.0.3 571.0 11.9 0.6%
/gnu/store/w9czy5s229aqninhk17vn1sfdjbwy4hs-cups-filters-1.0.68 555.8 8.7 0.5%
/gnu/store/mw87a68k0mha162nw1g9691bacjx0hwx-mysql-5.6.25 451.6 176.2 9.3%
[...]
/gnu/store/vp4vgmj8qbyrj78y4lqp8wqidaywcjwr-qt-4.8.7-doc 290.6 290.6 15.3%
/gnu/store/z7zjz3b1i5sbsx9kc1wy591dh69f7yd6-python-2.7.6 289.0 72.7 3.8%
[...]
/gnu/store/898yznjcrl22qhwd98v3jg8gvq1aqsk8-linux-libre-headers-3.14.37 95.2 3.4 0.2%
/gnu/store/cy7bp1l37q3f9p3llqkzanxx5lc7d1h0-glib-2.44.0 94.8 13.9 0.7%
/gnu/store/9k4618lnyczns5mjk3xrab72h650cwy3-libxft-2.3.2 92.2 0.2 0.0%
/gnu/store/5gi1bhrrfiipk5sxlasymnfvklzfcv0i-bootstrap-binaries-0 91.9 91.9 4.8%
[...]
--8<---------------cut here---------------end--------------->8---
That’s 1.9 GiB for the closure of Ardour 4, 15% of which is taken by the
Qt documentation (this specific issue seems non trivial to fix, though.)
MySQL alone is clearly taking too much space (176 MiB), and the closure
of Python is too big (289 MiB). Lastly, we end up pulling the bootstrap
binaries here, which should never happen (I believe this is fixed by
b15389e in core-updates.)
Feedback welcome!
Ludo’.
The ‘guix size’ command helps package developers profile the disk usage
of packages. It is easy to overlook the impact of an additional
dependency added to a package, or the impact of using a single output
for a package that could easily be split (*note Packages with Multiple
Outputs::). These are the typical issues that ‘guix size’ can
highlight.
The command can be passed a package specification such as ‘gcc-4.8’
or ‘guile:debug’, or a file name in the store. Consider this example:
$ guix size coreutils
store item total self
/gnu/store/…-coreutils-8.23 70.0 13.9 19.8%
/gnu/store/…-gmp-6.0.0a 55.3 2.5 3.6%
/gnu/store/…-acl-2.2.52 53.7 0.5 0.7%
/gnu/store/…-attr-2.4.46 53.2 0.3 0.5%
/gnu/store/…-gcc-4.8.4-lib 52.9 15.7 22.4%
/gnu/store/…-glibc-2.21 37.2 37.2 53.1%
The store items listed here constitute the "transitive closure" of
Coreutils—i.e., Coreutils and all its dependencies, recursively—as would
be returned by:
$ guix gc -R /gnu/store/…-coreutils-8.23
Here the output shows 3 columns next to store items. The first
column, labeled “total”, shows the size in mebibytes (MiB) of the
closure of the store item—that is, its own size plus the size of all its
dependencies. The next column, labeled “self”, shows the size of the
item itself. The last column shows the ratio of the item’s size to the
space occupied by all the items listed here.
In this example, we see that the closure of Coreutils weighs in at
70 MiB, half of which is taken by libc. (That libc represents a large
fraction of the closure is not a problem per se because it is always
available on the system anyway.)
When the package passed to ‘guix size’ is available in the store,
‘guix size’ queries the daemon to determine its dependencies, and
measures its size in the store, similar to ‘du -ms --apparent-size’
(*note (coreutils)du invocation::).
When the given package is _not_ in the store, ‘guix size’ reports
information based on information about the available substitutes (*note
Substitutes::). This allows it to profile disk usage of store items
that are not even on disk, only available remotely.
A single option is available:
‘--system=SYSTEM’
‘-s SYSTEM’
Consider packages for SYSTEM—e.g., ‘x86_64-linux’.
next reply other threads:[~2015-06-18 7:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-18 7:08 Ludovic Courtès [this message]
2015-06-21 21:42 ` guix size Ludovic Courtès
-- strict thread matches above, loose matches on Subject: below --
2015-06-18 7:35 Federico Beffa
2015-06-18 9:34 ` Taylan Ulrich Bayırlı/Kammer
2015-06-18 12:24 ` Ludovic Courtès
2015-06-18 18:22 ` Federico Beffa
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=87egl9sdck.fsf@gnu.org \
--to=ludo@gnu.org \
--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.