On Tue, 9 Jun 2020 at 10:34, Ludovic Courtès wrote: > Arun Isaac 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 |