unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: "Eli Zaretskii" <eliz@gnu.org>, "Mattias Engdegård" <mattiase@acm.org>
Cc: emacs-devel@gnu.org
Subject: Re: master 544db1e: Faster grep pattern for identifiers
Date: Wed, 15 Sep 2021 19:25:25 +0300	[thread overview]
Message-ID: <7b0409e3-fc88-b34e-9365-25356bb85859@yandex.ru> (raw)
In-Reply-To: <83h7elbzo3.fsf@gnu.org>

On 15.09.2021 18:56, Eli Zaretskii wrote:
>> branch: master
>> commit 544db1ee8679eec9edd5cee81a340ee1c4d70158
>> Author: Mattias Engdegård<mattiase@acm.org>
>>
>>      Faster grep pattern for identifiers
>>      
>>      * lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search):
>>      Use the `-w` flag instead of wrapping the pattern in regexps that make
>>      matching much slower.  This speeds up `xref-find-references` by about
>>      3× on macOS.
> Doesn't this change the semantics of the "word"?  The Grep notion of
> the word is not necessarily identical to that of Emacs, since the
> latter depends on the major mode.  The comment in the deleted code
> says that much, AFAICT.  Or what am I missing?

Luckily, -w actually corresponds to the regexp which the previous 
version of the code was using. Rather than to \<...\> which one might 
surmise from reading the docs for some versions of Grep (or Ripgrep).

And the comment was about \< and \>.

The latest Grep manual describes it correctly:

        -w, --word-regexp
               Select  only  those  lines  containing  matches  that 
form whole words.  The test is that the matching substring must either 
be at the beginning of the line, or preceded by a non-word
               constituent character.  Similarly, it must be either at 
the end of the line or followed by a non-word constituent character. 
Word-constituent characters are letters, digits, and  the
               underscore.



  reply	other threads:[~2021-09-15 16:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 15:56 master 544db1e: Faster grep pattern for identifiers Eli Zaretskii
2021-09-15 16:25 ` Dmitry Gutov [this message]
2021-09-15 16:33   ` Eli Zaretskii
2021-09-15 18:06     ` Dmitry Gutov
2021-09-15 18:14       ` Eli Zaretskii
2021-09-15 18:39         ` Dmitry Gutov
2021-09-16  7:28         ` Omar Polo
2021-09-15 16:29 ` Mattias Engdegård

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=7b0409e3-fc88-b34e-9365-25356bb85859@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.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).