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 QBJiMrHI5F68ewAA0tVLHw (envelope-from ) for ; Sat, 13 Jun 2020 12:38:09 +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 qAlILrHI5F42RQAA1q6Kng (envelope-from ) for ; Sat, 13 Jun 2020 12:38:09 +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 46D92940602 for ; Sat, 13 Jun 2020 12:38:08 +0000 (UTC) Received: from localhost ([::1]:36110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jk5QD-0002Jv-PI for larch@yhetil.org; Sat, 13 Jun 2020 08:38:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jk5QA-0002Jo-He for guix-patches@gnu.org; Sat, 13 Jun 2020 08:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jk5QA-0000Nd-96 for guix-patches@gnu.org; Sat, 13 Jun 2020 08:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jk5QA-0008CL-5H for guix-patches@gnu.org; Sat, 13 Jun 2020 08:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#39258] [PATCH 2/4] ui: Use string matching with literal search strings. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 13 Jun 2020 12:38: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: 39258@debbugs.gnu.org, zimoun Received: via spool by 39258-submit@debbugs.gnu.org id=B39258.159205187331492 (code B ref 39258); Sat, 13 Jun 2020 12:38:02 +0000 Received: (at 39258) by debbugs.gnu.org; 13 Jun 2020 12:37:53 +0000 Received: from localhost ([127.0.0.1]:41026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jk5Q1-0008Bs-Mp for submit@debbugs.gnu.org; Sat, 13 Jun 2020 08:37:53 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:45602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jk5Pz-0008Bj-PU for 39258@debbugs.gnu.org; Sat, 13 Jun 2020 08:37:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jbx0SkXo5juyhA0p2Y83NIpbe/dmAZZtSF666i/IlDI=; b=EGiD9b4o8ufklGEMbvzfKgXPb qtJMw6q0ByXsDO6fPdatZ2U0vAJQzWZAIIX+mi+LKc9TtTtTPVMXjZWATZi2c7ENJ0YNmCFr+k5TR Pa/E6CCYIviXeauV0Qhyxg9pzI6VWIlu2WDyym8554GhXXf0uYsUIN9D2KhGwd4/Dw8I4=; Received: from [192.168.2.1] (helo=steel) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jk5Pu-001LTR-23; Sat, 13 Jun 2020 18:07:46 +0530 From: Arun Isaac In-Reply-To: <87y2owmyf3.fsf@gnu.org> References: <20200601000030.7443-1-arunisaac@systemreboot.net> <20200601000030.7443-3-arunisaac@systemreboot.net> <87y2owmyf3.fsf@gnu.org> Date: Sat, 13 Jun 2020 18:07:45 +0530 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" 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=systemreboot.net header.s=default header.b=EGiD9b4o; dmarc=fail reason="SPF not aligned (relaxed)" header.from=systemreboot.net (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: -2.01 X-TUID: kCYaOXH+27mb --=-=-= Content-Type: text/plain >> * 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? See my results from earlier. --8<---------------cut here---------------start------------->8--- time ./pre-inst-env guix search game real 0m2.261s user 0m2.351s sys 0m0.104s --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- time guix search game real 0m2.661s user 0m2.843s sys 0m0.080s --8<---------------cut here---------------end--------------->8--- > I would expect the regexp engine in libc to do something similar > internally, so I wonder if the extra work in Scheme pays off. I agree it would better to do this optimization at the regexp engine, if it doesn't do it already. So, shall I push the remaining patches (patches 1, 3, 4) after applying the change you suggested for patch 1 (use of if versus cond)? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAl7kyJkACgkQLiXui2GA K7NJfwf/TPGvR5TUzosNFh3QFfh1xG4+FXINh28h/djH2E4fQPqsTJs9ohGyD0Re uA9TszCd/BBAKUNU4sMUQv+ucw6/37jVqAqTaP9XPM4UmyhcUwyMmoJ6GJJB+Y2f ndG7NkrF3bcQfXm9ZzGtj69zaJ+G/hQWmczO2C3us0odx8t+FHcUp79nWLpPweCX QY3Qa2e7vjAMWvQSqWGl1qc6Z089LY6GGy/KSYceFhrDV6gwrMyAEpvZrgzqpeLb CI97JXG/o7q32YKgYmxPiyjEqG2hMirnCc9Cudoqak218LG7++yR60Xy1K6cEDQ8 6QR82b2KpwbwSaZtgYsAQzfc6dSafA== =brgh -----END PGP SIGNATURE----- --=-=-=--