unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Jim Porter <jporterbugs@gmail.com>, 66806-done@debbugs.gnu.org
Subject: bug#66806: 30.0.50; [PATCH] 'project-find-regexp' passes Git submodules to the search program
Date: Mon, 30 Oct 2023 04:00:51 +0200	[thread overview]
Message-ID: <a1430ace-413f-1a95-ccc4-6b2dd715c2dc@gutov.dev> (raw)
In-Reply-To: <64f0f8b9-ea72-4bba-7d90-0e6c300e6154@gmail.com>

Version: 30.1

On 30/10/2023 02:58, Jim Porter wrote:
> On 10/29/2023 2:41 PM, Dmitry Gutov wrote:
>> And that's not to mention usage over Tramp (which would be affected by 
>> the +1 process call that you mentioned as well, but that seems 
>> unavoidable).
> 
> Yeah, I don't see a way around that, unless we constructed a complex 
> command to run via Tramp that does it all in one go.
> 
> (I looked into using the "--stage" argument for "git ls-files", which 
> gets most of the way to fixing this, but you could break that logic with 
> evil file names not in the tree...)

Filtering out gitlinks based on the mode bits? Clever.

Would probably slow down the parsing of the output, though. Not sure by 
how much.

>> Anyway, after recent experience micro-optimizing list operations, I 
>> came up with this version where the impact seems minimal.
>>
>> WDYT?
> 
> Thanks, that helped form the basis for the attached patch. It moves the 
> 'member' call into the lambda for the original 'mapcar', and then we can 
> just 'delq' all the nil elements. Benchmarking against the Emacs repo, 
> this still seems to have a minimal perf impact.

Ah, nice. delq is pretty handy to abbreviate the relinking.

We could combine both steps to eliminate an extra list altogether, but 
that only yields a further 2-3% improvement. Maybe later.

> There might also be a benefit to using "git ls-files 
> --recurse-submodules" when we can (i.e. when not using "-o"), but maybe 
> we can leave that optimization for another day.

As long as it doesn't result in too much code duplication.

Anyway, I've pushed your latest patch. Thanks! And closing.





  reply	other threads:[~2023-10-30  2:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29  5:36 bug#66806: 30.0.50; [PATCH] 'project-find-regexp' passes Git submodules to the search program Jim Porter
2023-10-29  6:06 ` Eli Zaretskii
2023-10-29 17:54   ` Jim Porter
2023-10-29 19:22     ` Eli Zaretskii
2023-10-29 22:14   ` Dmitry Gutov
2023-10-29 21:41 ` Dmitry Gutov
2023-10-30  0:58   ` Jim Porter
2023-10-30  2:00     ` Dmitry Gutov [this message]
2023-10-30  3:53       ` Jim Porter
2023-10-29 22:02 ` Dmitry Gutov
2023-10-30  0:25   ` Jim Porter

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=a1430ace-413f-1a95-ccc4-6b2dd715c2dc@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=66806-done@debbugs.gnu.org \
    --cc=jporterbugs@gmail.com \
    /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).