diff options
author | Taylor Blau <me@ttaylorr.com> | 2023-07-11 00:12:48 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-07-11 00:48:56 +0300 |
commit | 98456eff08069696708b24ab4f1152f06a3b47f9 (patch) | |
tree | 952ce3eab71207744306a532093e7f631afec5cf /t | |
parent | 18b6b1b5c57bb4d1b2730b664fb1660b006ef7d3 (diff) |
ls-refs.c: avoid enumerating hidden refs where possible
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 runs
Summary
'git.compile -c protocol.version=2 ls-remote .' ran
13.85 ± 0.33 times faster than 'git -c protocol.version=2 ls-remote .'
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
0 files changed, 0 insertions, 0 deletions