From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#50733: 28.0.1; project-find-regexp can block Emacs for a long time Date: Fri, 24 Sep 2021 09:03:51 +0300 Message-ID: <83o88itsqg.fsf@gnu.org> References: <03aa81b5-6077-c35c-1a5f-ec4d867b59ac@yandex.ru> <83wnn7vmya.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35469"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50733@debbugs.gnu.org, dgutov@yandex.ru To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 24 08:06:16 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 1mTeLg-0008yM-LR for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Sep 2021 08:06:16 +0200 Original-Received: from localhost ([::1]:47484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTeLf-0007BQ-5v for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Sep 2021 02:06:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTeKV-0005uC-Ax for bug-gnu-emacs@gnu.org; Fri, 24 Sep 2021 02:05:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44942) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mTeKV-0006oN-1E for bug-gnu-emacs@gnu.org; Fri, 24 Sep 2021 02:05:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mTeKU-00006W-SD for bug-gnu-emacs@gnu.org; Fri, 24 Sep 2021 02:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Sep 2021 06:05:02 +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.163246344632738 (code B ref 50733); Fri, 24 Sep 2021 06:05:02 +0000 Original-Received: (at 50733) by debbugs.gnu.org; 24 Sep 2021 06:04:06 +0000 Original-Received: from localhost ([127.0.0.1]:56480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTeJZ-0008Vy-U8 for submit@debbugs.gnu.org; Fri, 24 Sep 2021 02:04:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTeJY-0008VQ-7L for 50733@debbugs.gnu.org; Fri, 24 Sep 2021 02:04:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44332) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTeJS-0005rZ-PL; Fri, 24 Sep 2021 02:03:58 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4988 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTeJS-0001BL-CG; Fri, 24 Sep 2021 02:03:58 -0400 In-Reply-To: (message from Daniel =?UTF-8?Q?Mart=C3=ADn?= on Thu, 23 Sep 2021 22:42:32 +0200) 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:215258 Archived-At: > From: Daniel Martín > Cc: 50733@debbugs.gnu.org, dgutov@yandex.ru > Date: Thu, 23 Sep 2021 22:42:32 +0200 > > >> Elapsed time: 36.087181s (8.067474s in 22 GCs) > >> > >> Running the same search with ripgrep from the command line takes around > >> 6 seconds. > > > > How many matches does that report? > > ~70400 matches spread across ~3700 files. Perhaps it's an extreme case > (I used a generic search term, "color"). I tried a more specific search > term ("clang analyzer") which returned 30 matches across 14 files. > Here's the benchmark: > > Elapsed time: 10.176629s (0.946311s in 2 GCs) This means processing 70K lines of output takes 28 - 9 = 19 seconds, which is the lion's share of the run time in those situations. 9 sec to scan the files and 8 sec to GC. > I guess the command could signal ongoing progress somehow, to assure the > user that Emacs is actually working and not frozen. Currently, that's impossible, because we never return to the main loop while we wait for the process to terminate, so no Lisp can run during that time. That'd require to add a new hook, which the call-process machinery would call while we wait, or maybe even a C-level function to report the progress directly. Shouldn't be too hard, I think, see wait_for_termination.