* guix size
@ 2015-06-18 7:08 Ludovic Courtès
2015-06-21 21:42 ` Ludovic Courtès
0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2015-06-18 7:08 UTC (permalink / raw)
To: Guix-devel
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’.
^ permalink raw reply [flat|nested] 6+ messages in thread
* guix size
@ 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
0 siblings, 2 replies; 6+ messages in thread
From: Federico Beffa @ 2015-06-18 7:35 UTC (permalink / raw)
To: ludo; +Cc: Guix-devel
ludo@gnu.org (Ludovic Courtès) writes:
Nice!
> Here the output shows 3 columns next to store items. The first
> column, labeled “total”, shows the size in mebibytes (MiB) of the
typo: mebibytes
Regards,
Fede
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: guix size
2015-06-18 7:35 guix size Federico Beffa
@ 2015-06-18 9:34 ` Taylan Ulrich Bayırlı/Kammer
2015-06-18 12:24 ` Ludovic Courtès
1 sibling, 0 replies; 6+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2015-06-18 9:34 UTC (permalink / raw)
To: Federico Beffa; +Cc: Guix-devel
Federico Beffa <beffa@ieee.org> writes:
> ludo@gnu.org (Ludovic Courtès) writes:
>
> Nice!
>
>> Here the output shows 3 columns next to store items. The first
>> column, labeled “total”, shows the size in mebibytes (MiB) of the
>
> typo: mebibytes
>
> Regards,
> Fede
https://en.wikipedia.org/wiki/Mebibyte
Standardization mess, as always. :-)
Taylan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: guix size
2015-06-18 7:35 guix size 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
1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2015-06-18 12:24 UTC (permalink / raw)
To: Federico Beffa; +Cc: Guix-devel
Federico Beffa <beffa@ieee.org> skribis:
> ludo@gnu.org (Ludovic Courtès) writes:
>
> Nice!
>
>> Here the output shows 3 columns next to store items. The first
>> column, labeled “total”, shows the size in mebibytes (MiB) of the
>
> typo: mebibytes
No that’s intended: <https://en.wikipedia.org/wiki/Mebibyte>.
Ludo’.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: guix size
2015-06-18 12:24 ` Ludovic Courtès
@ 2015-06-18 18:22 ` Federico Beffa
0 siblings, 0 replies; 6+ messages in thread
From: Federico Beffa @ 2015-06-18 18:22 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: Guix-devel
On Thu, Jun 18, 2015 at 2:24 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Federico Beffa <beffa@ieee.org> skribis:
>
>> ludo@gnu.org (Ludovic Courtès) writes:
>>
>> Nice!
>>
>>> Here the output shows 3 columns next to store items. The first
>>> column, labeled “total”, shows the size in mebibytes (MiB) of the
>>
>> typo: mebibytes
>
> No that’s intended: <https://en.wikipedia.org/wiki/Mebibyte>.
Sorry! It's the first time I see this prefix. I thought you meant Mega.
Regards,
Fede
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: guix size
2015-06-18 7:08 Ludovic Courtès
@ 2015-06-21 21:42 ` Ludovic Courtès
0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2015-06-21 21:42 UTC (permalink / raw)
To: Guix-devel
[-- Attachment #1: Type: text/plain, Size: 248 bytes --]
With commit a8f996c, a new --map-file=foo.png option can be used to
create a PNG like the one below, thanks to Andy’s Guile-Charting. Maybe
not the optimal way to visualize this, but still quite useful IMO.
Comments welcome!
Ludo’.
[-- Attachment #2: Python 2 closure --]
[-- Type: image/png, Size: 22806 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-06-21 21:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-18 7:35 guix size 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
-- strict thread matches above, loose matches on Subject: below --
2015-06-18 7:08 Ludovic Courtès
2015-06-21 21:42 ` Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).