guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

‘xdg-mime-database’ profile hook is slow


From: Ludovic Courtès
Subject: ‘xdg-mime-database’ profile hook is slow
Date: Wed, 21 Oct 2020 11:49:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

Joshua Branson <jbranso@dismail.de> skribis:

> I don't want to complain (because I'm probably not going to be able to
> fix any issues that I spot), but it does seem to take a while for me to
> install packages, at least the XDG mime step.  It's not a huge issue for
> me.  I just realize that installing packages takes more time . :)  But
> if we are calling this an "issue", your suggestion to use numerous
> packages seems like a "work-around" rather than a "fix".

Just having identified which part is low is already a step forward.  :-)
I hadn’t noticed, but indeed the “XDG MIME database” steps takes a
while.  For my “big” user profile, on an SSD, it takes more than 4s:

--8<---------------cut here---------------start------------->8---
$ time guix build --check $(guix gc -R $(guix gc --derivers $(readlink -f 
~/.guix-profile)) |grep xdg-mime-database.drv)
The following profile hook will be built:
   /gnu/store/dhcv26m2k3kyx92wf9palp8byhblgjrr-xdg-mime-database.drv
building XDG MIME database...
successfully built 
/gnu/store/dhcv26m2k3kyx92wf9palp8byhblgjrr-xdg-mime-database.drv
/gnu/store/q25yv8hil0281x7zm25l259xvjfwwrsx-xdg-mime-database

real    0m4.241s
user    0m1.689s
sys     0m0.101s
$ guix package -I |wc -l
296
--8<---------------cut here---------------end--------------->8---

It’s worse on a cold cache:

--8<---------------cut here---------------start------------->8---
$ drv="$(guix gc -R $(guix gc --derivers $(readlink -f ~/.guix-profile)) |grep 
xdg-mime-database.drv)"
$ sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
$ time guix build --check "$drv"
The following profile hook will be built:
   /gnu/store/dhcv26m2k3kyx92wf9palp8byhblgjrr-xdg-mime-database.drv
building XDG MIME database...
successfully built 
/gnu/store/dhcv26m2k3kyx92wf9palp8byhblgjrr-xdg-mime-database.drv
/gnu/store/q25yv8hil0281x7zm25l259xvjfwwrsx-xdg-mime-database

real    0m5.872s
user    0m0.314s
sys     0m0.102s
--8<---------------cut here---------------end--------------->8---

And it’s probably worse on spinning disks?  What timings do you get?

We should profile this hook and see if it’s the ‘union-build’ call
that’s taking time or the ‘update-mime-database’ invocation.
‘union-build’ tends to be very I/O-intensive.

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]