From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id GxlCIQBd317lFwAA0tVLHw (envelope-from ) for ; Tue, 09 Jun 2020 09:57:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id +LS4HABd3164CAAA1q6Kng (envelope-from ) for ; Tue, 09 Jun 2020 09:57:20 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1AE4E9401CB for ; Tue, 9 Jun 2020 09:57:20 +0000 (UTC) Received: from localhost ([::1]:36672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jib0P-0003R6-Rz for larch@yhetil.org; Tue, 09 Jun 2020 05:57:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jib0A-0003Qv-DI for guix-patches@gnu.org; Tue, 09 Jun 2020 05:57:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jib0A-0005qO-4P for guix-patches@gnu.org; Tue, 09 Jun 2020 05:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jib0A-0001NT-22 for guix-patches@gnu.org; Tue, 09 Jun 2020 05:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#39258] [PATCH 2/4] ui: Use string matching with literal search strings. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 09 Jun 2020 09:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39258 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Arun Isaac , 39258@debbugs.gnu.org Received: via spool by 39258-submit@debbugs.gnu.org id=B39258.15916965775234 (code B ref 39258); Tue, 09 Jun 2020 09:57:02 +0000 Received: (at 39258) by debbugs.gnu.org; 9 Jun 2020 09:56:17 +0000 Received: from localhost ([127.0.0.1]:58976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jiazQ-0001MM-Kn for submit@debbugs.gnu.org; Tue, 09 Jun 2020 05:56:16 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:44139) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jiazO-0001M9-S4 for 39258@debbugs.gnu.org; Tue, 09 Jun 2020 05:56:15 -0400 Received: by mail-qk1-f195.google.com with SMTP id c14so20141454qka.11 for <39258@debbugs.gnu.org>; Tue, 09 Jun 2020 02:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=+F4FQojwOqaYCLYgf/1f+cC6vScgmEvK0R/7Zm/a8KM=; b=WfahGFvkIE8b7X2xzKfUu4hM9V5rPB0QqvkMHgF8UoHlFNypePf8rYHEz0/vpl2tQc MJynu6Y0hbkcLG7SkjUSyhasV6YP5sLC8YaPWJja7JidJC7B2uPt2BObdQD7qMi40W27 4ITulrdOQkUxJIK3kmUlkOlqv1vlD4t7P/ACAd19K5E0TuLJv5IWH3c0Psnl7FEThLbo RlBL0JcZytQkFWkH3BN5wp9aIJaRUAq3dH4qAA/M2IN4ZDcQwX96I53HtVIEh5O3LDHu U+Bv3XW24DwkUYKgfUjzbY4oQkpd8DmOrpSQnumaVgZm3SABF7MTHEKxONtPNaMh82QB gO8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=+F4FQojwOqaYCLYgf/1f+cC6vScgmEvK0R/7Zm/a8KM=; b=kMVnb3lHW2EQZ1iqhkaD3kWulxbEn6c31xfTuRY+yz2UiIeYjQxXO71Eovb2sOaNrq RdO10rjzYV0HLqfJgwCEugN1IUVf4JAw3zZG9L7CDAwlnEOnkiw3upvoUjWLGmpXD+uH Cl42aMio1qUwlb4VGBvqHuCNrHQO8+NMZf/8OP5uoiRq/RT8UkKIiLCyWvURJJRXQ6t2 tPjJOBrSfwEYtFV4uP11YnaBi8H7HaGaCCPPvGZO0KhZpLRcc2XnVnNOoCCO9sZgn86V +aDV5lYLZlMOX/MkXw/MLuwgqdQFsVNDKeFsbVsicSNDys4ImF6cFVWBnSFPZhMs62pv Rh8A== X-Gm-Message-State: AOAM5326BhZ7kdqMKRixQ3orhYyENlH4GUhM+fdLANV9xbSW7jEUMMBa bjXY9ArXC3HukH+myMtjqLD0gqAihdoR1LBWrNDTWeMS X-Google-Smtp-Source: ABdhPJycU0Du+2YzmO31QNjOK9UYsKlA2YO1XatjjLJ+83I0GzLbOKyVQUysbphiRewpIJogYTsCZauimjFeVOU3IGc= X-Received: by 2002:a37:4656:: with SMTP id t83mr26625709qka.126.1591696568243; Tue, 09 Jun 2020 02:56:08 -0700 (PDT) MIME-Version: 1.0 References: <20200601000030.7443-1-arunisaac@systemreboot.net> <20200601000030.7443-3-arunisaac@systemreboot.net> <87y2owmyf3.fsf@gnu.org> In-Reply-To: <87y2owmyf3.fsf@gnu.org> From: zimoun Date: Tue, 9 Jun 2020 11:55:56 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=WfahGFvk; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: bMBkQ65m5S/M On Tue, 9 Jun 2020 at 10:34, Ludovic Court=C3=A8s 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 stri= ngs 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 |