From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#26710: Fwd: 25.2; project-find-regexp makes emacs use 100% cpu Date: Tue, 02 May 2017 10:15:15 +0300 Message-ID: <83lgqfivb0.fsf@gnu.org> References: <87a86zu3gf.fsf@hari-laptop.i-did-not-set--mail-host-address--so-tickle-me> <83vapnktcn.fsf@gnu.org> <3d76a3ac-32ad-412d-349d-5904fc964a2b@yandex.ru> <83ziexka0s.fsf@gnu.org> <77b3a404-adac-fd1c-bd99-ad10e2450338@yandex.ru> <83inlljb5r.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1493709529 17597 195.159.176.226 (2 May 2017 07:18:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 May 2017 07:18:49 +0000 (UTC) Cc: hariharanrangasamy@gmail.com, 26710@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 02 09:18:44 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5S53-0004OA-LN for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 May 2017 09:18:41 +0200 Original-Received: from localhost ([::1]:57128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5S59-0000rq-6h for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 May 2017 03:18:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5S2V-0007cW-TU for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 03:16:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5S2U-0004Rg-UG for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 03:16:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52013) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5S2U-0004RY-RM for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 03:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d5S2U-00033H-Ik for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 03:16: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: Tue, 02 May 2017 07:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26710-submit@debbugs.gnu.org id=B26710.149370935611717 (code B ref 26710); Tue, 02 May 2017 07:16:02 +0000 Original-Received: (at 26710) by debbugs.gnu.org; 2 May 2017 07:15:56 +0000 Original-Received: from localhost ([127.0.0.1]:50212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5S2M-00032t-Ip for submit@debbugs.gnu.org; Tue, 02 May 2017 03:15:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5S2K-00032g-Uf for 26710@debbugs.gnu.org; Tue, 02 May 2017 03:15:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5S2B-00048T-3b for 26710@debbugs.gnu.org; Tue, 02 May 2017 03:15:47 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5S2A-000480-Ml; Tue, 02 May 2017 03:15:43 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1928 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d5S28-00086g-AJ; Tue, 02 May 2017 03:15:41 -0400 In-reply-to: (message from Dmitry Gutov on Tue, 2 May 2017 00:46:25 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:132180 Archived-At: > Cc: hariharanrangasamy@gmail.com, 26710@debbugs.gnu.org > From: Dmitry Gutov > Date: Tue, 2 May 2017 00:46:25 +0300 > > See commit c99a3b9. Please take a look at > xref--regexp-syntax-dependent-p specifically, and see if any significant > false negatives come to mind. Can you explain the significance of xref--regexp-syntax-dependent-p's tests? I don't know enough about xref to grasp that just by looking at the changes. > With this, project-find-regexp for 'emacs' finally completes in ~10 > seconds on my machine. It takes about 15 here (and 45 in an unoptimized build). I guess this slowdown is expected, since this is a 32-bit build --with-wide-int, so should be 30% slower than with native ints. I don't remember the original timings, but this looks like a good improvement, thanks. > >> What we _can_ manage to run in parallel, in the find-grep process in the > >> background, and the post-processing of the results in Elisp. > > > > Yes, you can -- if you invoke find-grep asynchronously and move the > > processing of the hits to the filter function. > > Yes, these parts are necessary either way. What I was describing would > go on top of them, as an abstraction. If the processing is in filter and sentinel functions, I'm not sure we will need any further speedups, because the UI will remain responsive. > > But that doesn't need > > to involve threads, and is being done in many packages/features out > > there, so I'm not sure what did you ask me to do with this. > > I imagined that the xref API that allows this kind of asynchronous > results might look better and more readable if it's implemented with > threads underneath. If you need advice for how to implement something like that, I can try helping with threads. > The main thing to understand is the xref API, not the internals of the > package. Well, I lack that understanding as well.