GNU bug report logs - #39258
Faster guix search using an sqlite cache

Previous Next

Package: guix-patches;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Thu, 23 Jan 2020 19:53:02 UTC

Severity: important

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, 39258 <at> debbugs.gnu.org
Subject: [bug#39258] [PATCH 2/4] ui: Use string matching with literal search strings.
Date: Tue, 9 Jun 2020 11:55:56 +0200
On Tue, 9 Jun 2020 at 10:34, Ludovic Courtès <ludo <at> gnu.org> wrote:
> Arun Isaac <arunisaac <at> systemreboot.net> skribis:
>
> > * guix/scripts/package.scm (process-query): Make search query a regexp only if
> > it is not a literal search string.
> > * guix/ui.scm (relevance): Use string matching with literal search strings and
> > regexp matching with regexp search strings.
>
> How does this affect performance?

On my machine, it changes nothing.

Even, I have applied the patches of the serie one by one to see the
effect on timing and I do not see an improvement.  Below an email that
I started but never completed. :-)
However, it seems to be The Right Thing to do. :-)

All the best,
simon

--

Here a quick benchmark.  Because once reading the code, I was not
convinced by the improvement. :-)
About the cut-off, the optimization should be hard to see because the
bottleneck is elsewhere. And I was doubtful about the string literal
but who knows. :-)

And to compare apple to apple, the patch set is rebased onto
a357849f5b as all the others.

Warm the cache is done by "guix search foo".


* Cut-off [PATCH 1/4]

The first patch: cut off i.e., finer implementation of '(map
regexp->score regexps)'.

** Query: crypto library

The query used is:

   guix search crypto library | recsel -P name | grep libb2

| cache | default  | v5       |
|-------+----------+----------|
| cold  | 0m2.083s | 0m2.292s |
| warm  | 0m1.404s | 0m1.470s |

And for another data point on the same query, see [1]:

| time | default  |
|------+----------|
| real | 0m2.216s | cold
|------+----------|
| real | 0m1.197s | warm

[1] http://issues.guix.gnu.org/issue/39258#78


** Query: strategy game

Using the query:

   guix search strategy game | recsel -P name | grep julius

| cache | default  | v5       |
|-------+----------+----------|
| cold  | 0m2.006s | 0m2.165s |
| warm  | 0m1.253s | 0m1.081s |


* String literal [PATCH 2/4] (+cut-off)

| cache | strategy game | crypto library |
|-------+---------------+----------------|
| cold  | 0m2.110s      | 0m2.246s       |
| warm  | 0m1.058s      | 0m1.217s       |




This bug report was last modified 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.