From: Dmitry Gutov <dgutov@yandex.ru>
To: Gregory Heytings <gregory@heytings.org>
Cc: 46859@debbugs.gnu.org
Subject: bug#46859: 28.0.50; [PATCH]: Add option to truncate long lines in xref.el
Date: Sun, 7 Mar 2021 01:00:39 +0200 [thread overview]
Message-ID: <a0e7e94f-f005-f8bb-c193-47c425bbbb7e@yandex.ru> (raw)
In-Reply-To: <7de1aeec52841199faed@heytings.org>
Hi Gregory,
On 07.03.2021 00:47, Gregory Heytings wrote:
> I just did a number of timing tests. The timings were done in a shell,
> on a fresh clone of the Emacs repository, which contains ~5000 files,
> and in which one searches for the 43 occurrences of "expose_frame".
>
> The timings are (in seconds):
>
> with GNU grep (version 3.6):
>
> 0.124 | "find -name '.?*' -prune -o -type f -print | xargs grep -i
> -snHE expose_frame"
> 0.178 | "find -name '.?*' -prune -o -type f -print | xargs grep -i
> -snobHE '.{0,50}expose_frame.{0,50}'"
> 0.253 | "find -name '.?*' -prune -o -type f -print | xargs grep -i
> -snobHE '.{0,80}expose_frame.{0,80}'"
> 0.325 | "find -name '.?*' -prune -o -type f -print | xargs grep -i
> -snobHE '.{0,100}expose_frame.{0,100}'"
>
> with ripgrep (version 12.1.1):
>
> 0.045 | "find -name '.?*' -prune -o -type f -print | xargs rg -i -nH
> --no-messages expose_frame"
> 0.079 | "find -name '.?*' -prune -o -type f -print | xargs rg -i -nobH
> --no-messages '.{0,50}expose_frame.{0,50}'"
> 0.109 | "find -name '.?*' -prune -o -type f -print | xargs rg -i -nobH
> --no-messages '.{0,80}expose_frame.{0,80}'"
> 0.113 | "find -name '.?*' -prune -o -type f -print | xargs rg -i -nobH
> --no-messages '.{0,100}expose_frame.{0,100}'"
>
> It seems that a reasonable compromise is a context of 80 characters,
> which is only two times slower than a string search with both GNU grep
> and ripgrep, and still very fast.
'find' is rarely the fastest way to list all the files in the project.
Have you timed it alone?
'git ls-files' is usually much faster, and that's what 'project-files'
uses under the covers. So if you redo your test with
'project-find-regexp' as I suggested, you might discover a different
slowdown multiplier.
> (FTR, I also compared these performances with ack, ag and git grep. To
> my surprise, they are much slower: ack is about three times slower than
> GNU grep on a string search, ag is a bit slower than GNU grep on string
> searches but much much slower on regexp searches, and git grep is a bit
> faster than ripgrep (and GNU grep) on string searches but again much
> much slower on regexp searches.)
ripgrep is generally the best all-arounder these days, though it might
be slower in certain odd cases.
'git grep' is not a real option because it uses Git's list of tracked
files directly, and we can't really do that. And that skews the comparisons.
next prev parent reply other threads:[~2021-03-06 23:00 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 20:40 bug#46859: 28.0.50; [PATCH]: Add option to truncate long lines in xref.el Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-01 22:07 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-02 19:25 ` Juri Linkov
2021-03-02 21:13 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-02 21:37 ` Dmitry Gutov
2021-03-02 21:45 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-02 22:14 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-02 22:37 ` Dmitry Gutov
2021-03-03 16:13 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-03 17:29 ` Dmitry Gutov
2021-03-03 19:54 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-06 22:26 ` Dmitry Gutov
2021-03-07 1:29 ` Dmitry Gutov
2021-03-07 3:22 ` Dmitry Gutov
2021-03-07 20:03 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-08 2:48 ` Dmitry Gutov
2021-03-07 20:16 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-07 20:26 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-08 2:56 ` Dmitry Gutov
2021-03-10 2:06 ` Dmitry Gutov
2021-05-17 15:27 ` Lars Ingebrigtsen
2021-05-17 15:44 ` Dmitry Gutov
2021-05-17 16:57 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-18 0:39 ` Dmitry Gutov
2021-03-03 9:05 ` Juri Linkov
2021-03-03 9:52 ` Gregory Heytings
2021-03-03 12:47 ` Dmitry Gutov
2021-03-03 13:53 ` Gregory Heytings
2021-03-03 14:00 ` Dmitry Gutov
2021-03-03 15:04 ` Gregory Heytings
2021-03-03 17:11 ` Gregory Heytings
2021-03-03 17:26 ` Dmitry Gutov
2021-03-03 17:42 ` Gregory Heytings
2021-03-03 19:14 ` Dmitry Gutov
2021-03-03 19:34 ` Gregory Heytings
2021-03-03 19:52 ` Juri Linkov
2021-03-03 20:34 ` Gregory Heytings
2021-03-04 3:36 ` Eli Zaretskii
2021-03-04 9:19 ` Gregory Heytings
2021-03-04 14:08 ` Eli Zaretskii
2021-03-04 14:39 ` Gregory Heytings
2021-03-04 15:13 ` Eli Zaretskii
2021-03-04 16:47 ` Gregory Heytings
2021-03-04 17:13 ` Eli Zaretskii
2021-03-04 17:35 ` Gregory Heytings
2021-03-04 18:28 ` Eli Zaretskii
2021-03-06 12:31 ` Dmitry Gutov
2021-03-06 12:37 ` Dmitry Gutov
2021-03-06 12:54 ` Gregory Heytings
2021-03-06 14:26 ` Dmitry Gutov
2021-03-06 22:47 ` Gregory Heytings
2021-03-06 23:00 ` Dmitry Gutov [this message]
2021-03-06 23:24 ` Gregory Heytings
2021-03-07 3:08 ` Dmitry Gutov
2021-03-07 8:13 ` Gregory Heytings
2021-03-08 3:24 ` Dmitry Gutov
2021-03-08 8:26 ` Gregory Heytings
2021-03-08 11:47 ` Dmitry Gutov
2021-03-06 12:49 ` Gregory Heytings
2021-03-06 14:07 ` Dmitry Gutov
2021-03-03 20:30 ` Dmitry Gutov
2021-03-03 21:06 ` Gregory Heytings
2021-03-06 12:44 ` Dmitry Gutov
2021-03-06 12:58 ` Gregory Heytings
2021-03-06 14:06 ` Dmitry Gutov
2021-03-06 22:55 ` Gregory Heytings
2021-03-03 19:59 ` Juri Linkov
2021-03-04 2:50 ` Dmitry Gutov
2021-03-04 9:24 ` Juri Linkov
2021-03-04 17:20 ` Dmitry Gutov
2021-03-04 17:56 ` Juri Linkov
2021-03-04 18:57 ` Dmitry Gutov
2021-03-06 12:39 ` Dmitry Gutov
2021-03-03 16:14 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a0e7e94f-f005-f8bb-c193-47c425bbbb7e@yandex.ru \
--to=dgutov@yandex.ru \
--cc=46859@debbugs.gnu.org \
--cc=gregory@heytings.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).