* Re: guix package --search slow ?
2019-05-15 13:34 ` Ludovic Courtès
@ 2019-05-15 13:43 ` Pierre Neidhardt
2019-05-16 15:13 ` Ludovic Courtès
2019-05-15 13:48 ` Jonathan Brielmaier
` (3 subsequent siblings)
4 siblings, 1 reply; 18+ messages in thread
From: Pierre Neidhardt @ 2019-05-15 13:43 UTC (permalink / raw)
To: Ludovic Courtès, zimoun; +Cc: Guix Devel
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
Ludovic Courtès <ludo@gnu.org> writes:
> We could probably improve the cold-cache timings by adding synopses and
> descriptions to the package cache that ‘guix pull’ builds in
> ~/.config/guix/current/lib/guix/package.cache, but that would also make
> that cache bigger. Not sure if it’s worth it.
To be clear, did you mean it might not be worth it because of the size
it takes on the user's drive or because the increase in size might slow
down the lookup?
For the former, currently my cache is 3.5 MiB big so I think it's safe
to go ahead and try if we get faster lookups with embedded synopses.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: guix package --search slow ?
2019-05-15 13:43 ` Pierre Neidhardt
@ 2019-05-16 15:13 ` Ludovic Courtès
0 siblings, 0 replies; 18+ messages in thread
From: Ludovic Courtès @ 2019-05-16 15:13 UTC (permalink / raw)
To: Pierre Neidhardt; +Cc: Guix Devel
Pierre Neidhardt <mail@ambrevar.xyz> skribis:
> Ludovic Courtès <ludo@gnu.org> writes:
>
>> We could probably improve the cold-cache timings by adding synopses and
>> descriptions to the package cache that ‘guix pull’ builds in
>> ~/.config/guix/current/lib/guix/package.cache, but that would also make
>> that cache bigger. Not sure if it’s worth it.
>
> To be clear, did you mean it might not be worth it because of the size
> it takes on the user's drive or because the increase in size might slow
> down the lookup?
If the cache is bigger, loading it may take a bit more time.
On an SSD, I find the timings to be acceptable now, so I’m also a bit
biased.
Ludo’.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: guix package --search slow ?
2019-05-15 13:34 ` Ludovic Courtès
2019-05-15 13:43 ` Pierre Neidhardt
@ 2019-05-15 13:48 ` Jonathan Brielmaier
2019-05-15 14:08 ` Pierre Neidhardt
2019-05-15 14:31 ` zimoun
2019-05-15 14:23 ` zimoun
` (2 subsequent siblings)
4 siblings, 2 replies; 18+ messages in thread
From: Jonathan Brielmaier @ 2019-05-15 13:48 UTC (permalink / raw)
To: Ludovic Courtès, zimoun; +Cc: Guix Devel
On 5/15/19 3:34 PM, Ludovic Courtès wrote:
> We could probably improve the cold-cache timings by adding synopses and
> descriptions to the package cache that ‘guix pull’ builds in
> ~/.config/guix/current/lib/guix/package.cache, but that would also make
> that cache bigger. Not sure if it’s worth it.
Another idea would be to have some kind of simple search which only
includes the package name and maybe the synopsis. So this could go to
the cache and I would assume that a cold-cache search will also be
faster. And as a nice give away, it doesn't include so much scrolling :)
So something like:
$ guix search --simple numpy
python-numpy | Fundamental package for scientific...
python-numpy-documentation | Documentation for the python-numpy...
python-numpydoc |
python2-numpy |
python2-numpy |
python2-numpy-documentation |
python2-numpydoc |
But in general I don't find the search so slow. Sometimes zypper for
example has to refresh the repos and than "guix search" is faster, even
with cold cache...
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: guix package --search slow ?
2019-05-15 13:48 ` Jonathan Brielmaier
@ 2019-05-15 14:08 ` Pierre Neidhardt
2019-05-15 14:50 ` zimoun
2019-05-15 14:31 ` zimoun
1 sibling, 1 reply; 18+ messages in thread
From: Pierre Neidhardt @ 2019-05-15 14:08 UTC (permalink / raw)
To: Jonathan Brielmaier, Ludovic Courtès, zimoun; +Cc: Guix Devel
[-- Attachment #1: Type: text/plain, Size: 395 bytes --]
> Another idea would be to have some kind of simple search which only
> includes the package name and maybe the synopsis.
For Emacs users, it's what helm-system-packages does. It implements its
own names+synopses cache. helm-system-packages takes some seconds on
first start to build the cache; after that you get instant live search! :)
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: guix package --search slow ?
2019-05-15 14:08 ` Pierre Neidhardt
@ 2019-05-15 14:50 ` zimoun
2019-05-15 15:11 ` Pierre Neidhardt
0 siblings, 1 reply; 18+ messages in thread
From: zimoun @ 2019-05-15 14:50 UTC (permalink / raw)
To: Pierre Neidhardt; +Cc: Guix Devel
Hi Pierre,
On Wed, 15 May 2019 at 16:08, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
>
> > Another idea would be to have some kind of simple search which only
> > includes the package name and maybe the synopsis.
>
> For Emacs users, it's what helm-system-packages does. It implements its
> own names+synopses cache. helm-system-packages takes some seconds on
> first start to build the cache; after that you get instant live search! :)
You are doing ads for your package ;-)
Well, I cite your doctring [1], that's the point.
Guix is extremely slow to list everything, thus the cache is
persisted on drive. It's only updated whenever
`helm-system-packages-guix--last-pull-commits' is different from the
cache commit.
And what do mean by this comment [2]
;; We build both caches at the same time. We could also build just-in-time, but
;; benchmarks show that it only saves less than 20% when building one cache.
Last, the "slowness" comes from `guix package --search` doing there
[3], I guess.
What is the size of the persistent cache?
[1] https://github.com/emacs-helm/helm-system-packages/blob/master/helm-system-packages-guix.el#L141
[2] https://github.com/emacs-helm/helm-system-packages/blob/master/helm-system-packages-guix.el#L148
[3] https://github.com/emacs-helm/helm-system-packages/blob/master/helm-system-packages-guix.el#L163
Cheers,
simon
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: guix package --search slow ?
2019-05-15 14:50 ` zimoun
@ 2019-05-15 15:11 ` Pierre Neidhardt
0 siblings, 0 replies; 18+ messages in thread
From: Pierre Neidhardt @ 2019-05-15 15:11 UTC (permalink / raw)
To: zimoun; +Cc: Guix Devel
[-- Attachment #1: Type: text/plain, Size: 915 bytes --]
zimoun <zimon.toutoune@gmail.com> writes:
>> For Emacs users, it's what helm-system-packages does. It implements its
>> own names+synopses cache. helm-system-packages takes some seconds on
>> first start to build the cache; after that you get instant live search! :)
>
> You are doing ads for your package ;-)
Helm, what else... :p
> And what do mean by this comment [2]
>
> ;; We build both caches at the same time. We could also build just-in-time, but
> ;; benchmarks show that it only saves less than 20% when building one cache.
Here "caches" refer to the internal in-memory caches of
helm-system-packages, this has nothing to do with the "guix search..."
cache. Poor phrasing, admittedly. :/
> Last, the "slowness" comes from `guix package --search` doing there
> [3], I guess.
Yes, helm-system-packages relies on "guix search".
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: guix package --search slow ?
2019-05-15 13:48 ` Jonathan Brielmaier
2019-05-15 14:08 ` Pierre Neidhardt
@ 2019-05-15 14:31 ` zimoun
1 sibling, 0 replies; 18+ messages in thread
From: zimoun @ 2019-05-15 14:31 UTC (permalink / raw)
To: Guix Devel
On Wed, 15 May 2019 at 15:48, Jonathan Brielmaier
<jonathan.brielmaier@web.de> wrote:
>
> On 5/15/19 3:34 PM, Ludovic Courtès wrote:
> > We could probably improve the cold-cache timings by adding synopses and
> > descriptions to the package cache that ‘guix pull’ builds in
> > ~/.config/guix/current/lib/guix/package.cache, but that would also make
> > that cache bigger. Not sure if it’s worth it.
>
> Another idea would be to have some kind of simple search which only
> includes the package name and maybe the synopsis. So this could go to
> the cache and I would assume that a cold-cache search will also be
> faster. And as a nice give away, it doesn't include so much scrolling :)
`guix package -A` already searches only for the names and uses the cache.
From my opinion, the difference between adding the synopsis or
synopsis+description to the cache is similar. Qui peut le plus peut le
moins (Who can do more can do less too ;-)
> But in general I don't find the search so slow. Sometimes zypper for
> example has to refresh the repos and than "guix search" is faster, even
> with cold cache...
I agree that now the performance are not so "horrible", but even, can
we do better? :-)
All the best,
simon
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: guix package --search slow ?
2019-05-15 13:34 ` Ludovic Courtès
2019-05-15 13:43 ` Pierre Neidhardt
2019-05-15 13:48 ` Jonathan Brielmaier
@ 2019-05-15 14:23 ` zimoun
2019-05-15 18:32 ` zimoun
2019-05-15 20:30 ` Giovanni Biscuolo
4 siblings, 0 replies; 18+ messages in thread
From: zimoun @ 2019-05-15 14:23 UTC (permalink / raw)
To: Guix Devel
Hi,
On Wed, 15 May 2019 at 15:34, Ludovic Courtès <ludo@gnu.org> wrote:
>
> For the record, commit 94aeec0aef03ab44e41bfc3e77c3b623cb3d607c, shortly
> before 1.0, make ‘guix search’ faster (as in less CPU usage.)
Six time faster the commit message claims ;-)
Awesome how only 2 lines change things.
> The cold-cache timings are worse for Guix, which ends up doing a lot of
> I/O to traverse all these .scm files; APT only has to go through a
> couple of files I guess.
Hum? I do not know how APT (say the `aptitude` implementation) works.
I suppose that `aptitude update` pulls then hashes somehow a database/cache.
I mean reduce the I/O with all these scattered .scm files should
improve the timings.
> The warm-cache timings are comparable though, which I think is good.
> :-)
Yes! :-)
However, because the first search is slow, the final feeling is that
`guix search` is slow. :-(
> We could probably improve the cold-cache timings by adding synopses and
> descriptions to the package cache that ‘guix pull’ builds in
> ~/.config/guix/current/lib/guix/package.cache, but that would also make
> that cache bigger. Not sure if it’s worth it.
Hum? and why not use SQLite for this file?
All the best,
simon
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: guix package --search slow ?
2019-05-15 13:34 ` Ludovic Courtès
` (2 preceding siblings ...)
2019-05-15 14:23 ` zimoun
@ 2019-05-15 18:32 ` zimoun
2019-05-15 20:30 ` Giovanni Biscuolo
4 siblings, 0 replies; 18+ messages in thread
From: zimoun @ 2019-05-15 18:32 UTC (permalink / raw)
To: Guix Devel
Hi,
My bad !
On Wed, 15 May 2019 at 15:34, Ludovic Courtès <ludo@gnu.org> wrote:
> The warm-cache timings are comparable though, which I think is good.
> :-)
`aptitude search` is not equivalent to `guix package --search` but to
`guix package --list-available`.
The `aptitude` equivalence should be `aptitude search '?term(numpy)'`
And now, Guix is better. ;-)
$ time guix package -s numpy
real 0m7.924s
user 0m1.240s
sys 0m0.144s
$ time guix package -s conduit
real 0m0.758s
user 0m0.796s
sys 0m0.044s
compared to:
$ time aptitude search '?term(numpy)'
real 0m7.393s
user 0m1.556s
sys 0m0.628s
$ time aptitude search '?term(conduit)'
real 0m1.824s
user 0m1.352s
sys 0m0.464s
However, I still think that a SQL caching file containing also
descriptions should improve the searching experience with cold cache.
Thanks! Now I have better understood some internals. :-)
All the best,
simon
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: guix package --search slow ?
2019-05-15 13:34 ` Ludovic Courtès
` (3 preceding siblings ...)
2019-05-15 18:32 ` zimoun
@ 2019-05-15 20:30 ` Giovanni Biscuolo
4 siblings, 0 replies; 18+ messages in thread
From: Giovanni Biscuolo @ 2019-05-15 20:30 UTC (permalink / raw)
To: Ludovic Courtès, zimoun; +Cc: Guix Devel
[-- Attachment #1: Type: text/plain, Size: 469 bytes --]
Hello Ludovic,
Ludovic Courtès <ludo@gnu.org> writes:
[...]
> We could probably improve the cold-cache timings by adding synopses and
> descriptions to the package cache that ‘guix pull’ builds in
> ~/.config/guix/current/lib/guix/package.cache, but that would also make
> that cache bigger. Not sure if it’s worth it.
AFAIU it's worth it, at least in terms of disk space
Thanks,
Gio'.
--
Giovanni Biscuolo
Xelera IT Infrastructures
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread