From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#50733: 28.0.1; project-find-regexp can block Emacs for a long time Date: Mon, 27 Sep 2021 12:25:04 +0000 Message-ID: <2391d2ad6f7f0febec7c@heytings.org> References: <03aa81b5-6077-c35c-1a5f-ec4d867b59ac@yandex.ru> <63300a34-e487-02d1-c182-2b84438654d7@yandex.ru> <83k0j6trau.fsf@gnu.org> <838rzmtf00.fsf@gnu.org> <83sfxurr67.fsf@gnu.org> <83ilypsw31.fsf@gnu.org> <83h7e9stbm.fsf@gnu.org> <835yuprx1d.fsf@gnu.org> <2391d2ad6f5d14256480@heytings.org> <83fstqmwgu.fsf@gnu.org> <2391d2ad6f1301eed00b@heytings.org> <83y27ikznt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20869"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50733@debbugs.gnu.org, dgutov@yandex.ru, mardani29@yahoo.es To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 27 14:26:25 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mUpiC-0005Ds-CM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Sep 2021 14:26:24 +0200 Original-Received: from localhost ([::1]:57040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUpiA-0004ok-KD for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Sep 2021 08:26:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUphq-0004lS-7j for bug-gnu-emacs@gnu.org; Mon, 27 Sep 2021 08:26:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUphp-00014d-W8 for bug-gnu-emacs@gnu.org; Mon, 27 Sep 2021 08:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUphp-0007WP-OQ for bug-gnu-emacs@gnu.org; Mon, 27 Sep 2021 08:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Sep 2021 12:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50733 X-GNU-PR-Package: emacs Original-Received: via spool by 50733-submit@debbugs.gnu.org id=B50733.163274550828829 (code B ref 50733); Mon, 27 Sep 2021 12:26:01 +0000 Original-Received: (at 50733) by debbugs.gnu.org; 27 Sep 2021 12:25:08 +0000 Original-Received: from localhost ([127.0.0.1]:39958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUpgy-0007Uu-CF for submit@debbugs.gnu.org; Mon, 27 Sep 2021 08:25:08 -0400 Original-Received: from heytings.org ([95.142.160.155]:50050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUpgv-0007Ug-Vr for 50733@debbugs.gnu.org; Mon, 27 Sep 2021 08:25:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1632745504; bh=FzuHcV0vf1eHQpvXoR4FKynNXEd5LC4sGh3xJt+JeTc=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=nnMWfQ6dAsWIQX7/g/3sJgHVTSqEZckjpU9XTtHKfngxtKtSnkNroQiwTJ8uICB5W S6HDgldrNzh+qBJNTwR58HTBDAAEurndRdfrai6Oq9ZjsHaz54nR8NZm7eLzGitIL4 uQw1qbV4VFpuQ9Fr4VvCXPsohIwIvUuucRxtpJ9omz6FWe1OCb/NeRHAehtpTeYgFL Cy55BMLCptsjTNf91yhpMmx+nY7OG4d828emUXE3VyL2mCcbWIxfMaRUkQFTc9xo3W cP5gw7NVpjSJuwkFbp0qyMlPnb9d36l6wmOZSIuG+Fg2M3oFC6hDMjVErNYAFAAZZp D6lEr6BkZsGsA== In-Reply-To: <83y27ikznt.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:215654 Archived-At: > > But the scalability you measured is approximately O(n), as expected from > a tool that accesses the files while searching. IDUtils' gid basically > runs in O(1) time. I've just run it on a tree with 17MB of code in 400 > files (ID database size 54KB) and on a tree with 1.4GB of code in 40,000 > files (DB size 13.5MB), and I get the same time for the same search: > 15ms. No algorithm that actually accesses most or all of the files in > the tree can scale like that. > Of course a table lookup is O(1) and a search is O(n). If and only if you forget the time it takes to build the table and to keep it up to date. According to my tests, 1 call to mkid followed by 100 calls to gid is still slower than 100 calls to rg; the "break-even point" is somewhere around 200 searches. I agree with you on one point: it is perhaps possible to make rg even faster with a database cache.