Re: [PATCH v4 16/16] ls-refs.c: avoid enumerating hidden refs where possible
- From
Jeff King <peff@peff.net>
- Date
- Jul 3, 2023, 06:27 UTC
- Message-ID
- <20230703062748.GJ3502534@coredump.intra.peff.net>
- In-Reply-To
- <ea6cbaf292f59c96bedc304c74a36fe1c53c1c6d.1687270849.git.me@ttaylorr.com>
On Tue, Jun 20, 2023 at 10:22:22AM -0400, Taylor Blau wrote:
Show 13 quoted lines
> In a similar fashion as in previous commits, teach `ls-refs` to avoid
> enumerating hidden references where possible.
>
> As before, this is linux.git with one hidden reference per commit.
>
> $ hyperfine -L v ,.compile 'git{v} -c protocol.version=2 ls-remote .'
> Benchmark 1: git -c protocol.version=2 ls-remote .
> Time (mean ± σ): 89.8 ms ± 0.6 ms [User: 84.3 ms, System: 5.7 ms]
> Range (min … max): 88.8 ms … 91.3 ms 32 runs
>
> Benchmark 2: git.compile -c protocol.version=2 ls-remote .
> Time (mean ± σ): 6.5 ms ± 0.1 ms [User: 2.4 ms, System: 4.3 ms]
> Range (min … max): 6.2 ms … 8.3 ms 397 runsVery nice. I think this may have big real-world consequences for certain repositories on forges (where they may accrue a large number of hidden metadata like refs/pull).
-Peff