bug-global
[Top][All Lists]
Advanced

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

Re: Feature request: External grep support


From: Marcus Harnisch
Subject: Re: Feature request: External grep support
Date: Thu, 30 Apr 2020 09:41:06 +0200

Hi Shigio

Yes, of course. Here is the sequence of commands (grepping for the fixed string “grep”). You may want to run a dummy command first to fill the file system cache.
$ cd emacs-master
$ gtags
$ du -ch $(global -P) | tail -n 1
79M total
$ time global -g grep > /dev/null

real 0m0,261s
user 0m0,257s
sys 0m0,004s
$ time grep -l grep $(global -P) >/dev/null

real 0m0,064s
user 0m0,048s
sys 0m0,016s
$ time rg -l grep $(global -P) >/dev/null

real 0m0,027s
user 0m0,036s
sys 0m0,020s

Regards,
Marcus

On Thu, Apr 30, 2020 at 6:28 AM Shigio YAMAGUCHI <address@hidden> wrote:
Hi Marcus,
Could you please give me an example of the command line to understand the issue?
I'm not sure what you did.

Thanks,
Shigio

2020年4月30日(木) 6:12 Marcus Harnisch <address@hidden>:
>
> Hi Shigio
>
> Until now I hadn't noticed that global has its own grep implementation.
> It turns out that running ‘grep -l’ with a fixed string pattern on the list of files obtained with ‘global -P’ consumes about a quarter of the time of the corresponding ‘global -g’ command in a non-trivial code base (emacs-master, total size of files searched amounting to 79MB).
> Modern grep replacements, such as ripgrep (https://github.com/BurntSushi/ripgrep) are even faster than that. Exact numbers will obviously differ based on the actual pattern used.
> Perhaps grep() could be changed to off-loading to an external tool (possibly even configurable via gtags.conf)
>
> Thanks,
> Marcus



--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F  1C33 969C 3BE3 89DD A6EB

reply via email to

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