all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: guix package is slow
Date: Mon, 02 Jul 2018 11:48:17 -0400	[thread overview]
Message-ID: <87h8lhtz9a.fsf@gmail.com> (raw)
In-Reply-To: <87sh52hrc2.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 02 Jul 2018 12:20:13 +0200")

Hi!

ludo@gnu.org (Ludovic Courtès) writes:

> Hello!
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> swedebugia@riseup.net writes:
>>
>>> Hi
>>>
>>> I would like guix package -A/s to be faster.
>>> There it takes >3s every time I run the command.
>
> It’s at 1.5s for me on an SSD and a hot cache, but I agree that overall
> it’s too slow.
>
>> I agree that Guix is rather slow when comparing it to traditional
>> package managers such as apt; I think the main reason, as you found, is
>> that it has to load all the byte-compiled package definition files.
>
> That, and also it generally has “more work” to do (see ‘apt-get update’
> vs. ‘guix pull’, or even ‘guix package -i emacs’ vs. ‘apt-get install
> emacs’.)  That’s not meant as an excuse, just a clarification of what’s
> going on.

True, especially for guix pull ;)

>>> Would it be possible to populate an index or something when pulling so
>>> that we have the information in a sqlite-db instead of traversing 40
>>> go-files with guile?
>>
>> I remember asking Ludovic in #guix if Guile would be able to compete
>> with database software in terms of performance, and he said there are
>> ways we can make it faster.
>
> I think we could easily optimize package lookups by name.  Instead of
> traversing the whole list of package modules to build up a name/package
> table, we could have a pre-built cache containing that mapping.  That
> way, when typing “guix build emacs”, we could essentially translate that
> to “guix build -e '(@ (gnu packages emacs) emacs)'”, which is a little
> bit faster.
>
> We could arrange for the cache to be enough for operations such as “guix
> package -A”, so that we don’t need to load a single package module.
>
>> I'm not very knowledgeable myself about Guile but if we could make it
>> support static linking, to load only one binary rather than hundreds
>> in the case of Guix, that would be one way to speed things. Next thing
>> might be to implement native compilation.
>
> You might like this:
>
>   https://lists.gnu.org/archive/html/guile-devel/2018-06/msg00026.html

Interesting developments are coming to Guile, it seems :). I'm happy to
see that Andy is still driving Guile forward. Thanks!

>>> On an older guixsd with about 4k packages the delay was noticeably
>>> shorter. 
>>
>> I guess the time it takes grows linearly (I hope!) with the number of
>> packages/modules it has to load. We're now at double that amount of
>> packages (IIRC), so Guix might take double the time it used to.
>
> Yeah, that’s why the cache is probably unavoidable.

Thanks for sharing your insights on the matter!

Maxim

  reply	other threads:[~2018-07-02 15:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-30 15:20 guix package is slow swedebugia
2018-06-30 15:25 ` Pierre Neidhardt
2018-07-01 15:34   ` Maxim Cournoyer
2018-07-01 18:50     ` Pierre Neidhardt
2018-07-01 19:33       ` Maxim Cournoyer
2018-07-01 19:41         ` Pierre Neidhardt
2018-07-01 20:18           ` Maxim Cournoyer
2018-07-01 20:32             ` Pierre Neidhardt
2018-07-02  1:04           ` Oleg Pykhalov
2018-07-02 14:55             ` Maxim Cournoyer
2018-07-02 20:28               ` Alex Kost
2018-07-03 17:06                 ` swedebugia
2018-07-03 19:39                 ` Ludovic Courtès
2018-07-08 16:05                 ` Maxim Cournoyer
2018-07-09 16:42                 ` George Clemmer
2018-07-10  2:45                   ` Oleg Pykhalov
2018-07-02 20:39           ` Alex Kost
2018-07-01 15:32 ` Maxim Cournoyer
2018-07-02 10:20   ` Ludovic Courtès
2018-07-02 15:48     ` Maxim Cournoyer [this message]
2018-07-02 13:36 ` ‘package-transitive-supported-systems’ " Ludovic Courtès

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=87h8lhtz9a.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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.