Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Tamir Duberstein" <tamird@gmail.com>,
	git@vger.kernel.org, "René Scharfe" <l.s.r@web.de>,
	"Patrick Steinhardt" <ps@pks.im>
Subject: Re: [PATCH v2] ls-files: filter pathspec before lstat
Date: Thu, 11 Jun 2026 10:38:07 -0700	[thread overview]
Message-ID: <xmqqfr2tnfk0.fsf@gitster.g> (raw)
In-Reply-To: <20260611084132.GK2191159@coredump.intra.peff.net> (Jeff King's message of "Thu, 11 Jun 2026 04:41:32 -0400")

Jeff King <peff@peff.net> writes:

>> Yeah, absolutely it's arbitrary. The simplest answer is that others
>> are welcome to bump this, provided they make the case for it.
>
> OK. I can live with, I suppose, but I am tempted to say that it should
> just kick in always (i.e., removing the pathspec.nr check).

Yeah, that is certainly simpler, and this ...

> Though I did show a case where the performance regresses, it was pretty
> made-up and not something I'd expect in the real world. And you'd see
> that same crappy performance with "git ls-files -- $(git ls-files)",
> without the "-m".

... makes it clear that "trigger only when there is one element in
the pathspec" is optimizing for a wrong case.

I think we want the log message document that this kind of thinking
went into the final choice of the heuristics, like, "trigger only
when there is one because ...", or "even though it would actually be
an anti-optimization when the pathspec has enourmous number of
elements, we always use this optimization because ...", but as long
as that is done, either solution is fine.

Thanks.

      parent reply	other threads:[~2026-06-11 17:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  2:37 [PATCH v2] ls-files: filter pathspec before lstat Tamir Duberstein
2026-06-09  3:26 ` Junio C Hamano
2026-06-09  3:38   ` Tamir Duberstein
2026-06-09  3:42   ` Junio C Hamano
2026-06-09  3:48     ` Tamir Duberstein
2026-06-09 10:41 ` Jeff King
2026-06-09 23:15   ` Tamir Duberstein
2026-06-11  8:41     ` Jeff King
2026-06-11 15:17       ` Tamir Duberstein
2026-06-11 17:38       ` Junio C Hamano [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqfr2tnfk0.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    --cc=peff@peff.net \
    --cc=ps@pks.im \
    --cc=tamird@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox