Re: [PATCH 1/1] ls-refs.c: minimize number of refs visited
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jan 19, 2021, 23:02 UTC
- Message-ID
- <YAdlGMv3EC1ORUew@nand.local>
- In-Reply-To
- <YAdkVkXOnpDy28h2@coredump.intra.peff.net>
On Tue, Jan 19, 2021 at 05:59:34PM -0500, Jeff King wrote:
> Actually, I am not sure that we would look for "refs/tags/" in that case > (I did a quick test and we do not seem to). Which makes sense, as it is > cheaper to find the "a" and "b" hierarchies separately if there is a > very big "refs/tags/c" hierarchy.
Ah, makes sense. Thanks for double checking.
> But I agree that this is a good reason that callers should consider it > as an optimization which could return more results than expected.
Yep. Even though I couldn't quite remember when the algorithm would split without looking more closely, I made sure to document that it iterates *all* references that are descendent of the LCP of its arguments.
> -Peff
Thanks, Taylor