emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vc-git-grep vs project-find-regexp


From: Dmitry Gutov
Subject: Re: vc-git-grep vs project-find-regexp
Date: Wed, 13 Sep 2023 00:05:45 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Hi!

On 21/08/2023 18:29, Nicolás Ojeda Bär wrote:
While it seems to work well, project-find-regexp seems much slower
than vc-git-grep. After you execute the command, it pauses for what it
feels a long time (~2s in a medium-size codebase) before showing the
results. vc-git-grep on the other hand, starts displaying results
immediately.

Have you tried measuring the time until Grep finishes too (not just until the output buffer is shown)? It's likely to be faster by that measure as well (for the moment), but that's not a certainty. Just curious how those compare as well.

Is there a good reason for this difference? The only visible
difference between both commands is that project-find-regexp's results
are displayed in a XREF buffer while vc-git-grep uses Grep mode.

Xref uses a couple of abstractions to be able to show information from different sources. That has a cost, however. To be able to show the results buffer right away (while the search is in progress), requires more effort, including:

- Listing files in a project asynchronously (so that intermediate reporting is possible) with performance comparable to the synchronous approach, simply is order not to regress on that speed (there is some progress, I think, in the latest messages in bug#64735).

- To build on that, using some more advanced data structures than just lists for project files and search matches. Lazy sequences of futures, maybe.

The ability to abort a search in progress will require some thought too: currently it comes for free with 'C-g' in Xref; in Grep it's one 'C-c C-c' away because the reference to the process is available; but if we do an opaque data structure, it could need an "abort" primitive as well.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]