unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41702: `guix environment` performance issues
@ 2020-06-04  8:23 Lars-Dominik Braun
  2020-06-06 16:08 ` Ludovic Courtès
  0 siblings, 1 reply; 25+ messages in thread
From: Lars-Dominik Braun @ 2020-06-04  8:23 UTC (permalink / raw)
  To: 41702

[-- Attachment #1: Type: text/plain, Size: 2090 bytes --]

Hi,

I’ve noticed that `guix environment` can be very very slow for some packages.
Whereas usually a call like

	time guix environment --ad-hoc <package> -- true

takes 600ms to 1.5s, it takes 8.4s for the package r-learnr on my Ryzen 5 3600
with NVMe SSD, 32G of RAM and a warm cache. This seems to accumulate when
trying to install multiple unrelated “slow” packages into the same environment,
i.e. jupyter (2.9s) + r-rlearnr (8.4s) + r-stm (2.9s) = 12.1s. What these
packages seem to have in common is a deep chain of propagated inputs.

And in fact, if I create artificial test packages where test-999 propagates
test-998, test-998→test-997 and so on the command above takes 1m 9s. A single
package propagating 999 packages takes 4.5s.

Instrumenting guix-environment’s with-store call with statprof I see a lot of
time is spent in the garbage collector:

Total time: 24.672604202 seconds (19.431122691 seconds in GC)
./pre-inst-env guix environment --ad-hoc r-learnr -- true  25,18s user 0,24s system 308% cpu 8,248 total

More specifically in an anonymous function and reap-pipes, which is a gc hook,
I believe:

%     cumulative   self
time   seconds    seconds   calls   procedure
 33.41     14.49      8.24                            anon #xbb8480
 27.95      6.90      6.90                            ice-9/popen.scm:145:0:reap-pipes
  4.37      1.08      1.08                            anon #xbbdcd8
  3.28      0.86      0.81                            ice-9/vlist.scm:539:0:vhash-assq
  2.40      2.37      0.59                            guix/grafts.scm:202:22

Not sure if that helps tracking the issue down though.

Cheers,
Lars

PS: Here’s `guix describe`:
Generation 1	Jun 03 2020 10:38:17	(current)
  guix 9ab2790
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 9ab2790e2acf872c0f2cf41ec180de80d1eee3f3
  zpid bab33c1
    repository URL: https://github.com/leibniz-psychology/guix-zpid.git
    branch: master
    commit: bab33c19e0f0304d7aa82751653eb85d8cad8c0a


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2020-10-26  8:38 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-04  8:23 bug#41702: `guix environment` performance issues Lars-Dominik Braun
2020-06-06 16:08 ` Ludovic Courtès
2020-06-06 21:40   ` Ludovic Courtès
2020-06-08  9:04   ` Lars-Dominik Braun
2020-06-08 21:59     ` Ludovic Courtès
2020-06-09  9:15       ` Lars-Dominik Braun
2020-06-27 21:20         ` Ludovic Courtès
2020-06-30  9:59           ` Lars-Dominik Braun
2020-07-01 10:49           ` Ludovic Courtès
2020-07-01 11:24             ` Lars-Dominik Braun
2020-07-01 21:53               ` Ludovic Courtès
2020-07-02  7:00                 ` Lars-Dominik Braun
2020-07-02 12:03                   ` Lars-Dominik Braun
2020-07-06  8:49                     ` Ludovic Courtès
2020-07-06 12:58                       ` Lars-Dominik Braun
2020-07-20  9:50                         ` Lars-Dominik Braun
2020-07-20 21:51                           ` Ludovic Courtès
2020-10-22 21:03                             ` Maxim Cournoyer
2020-10-23  7:26                               ` Lars-Dominik Braun
2020-10-23 13:07                                 ` bug#44175: [optimization] Grafting is too slow Maxim Cournoyer
2020-10-23 21:17                                   ` Ludovic Courtès
2020-10-25  2:33                                     ` Maxim Cournoyer
2020-10-25 16:43                                       ` Ludovic Courtès
2020-10-26  7:56                                         ` Lars-Dominik Braun
2020-10-23 14:51                                 ` bug#41702: `guix environment` performance issues 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).