summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-03-04 11:49:40 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-04 10:19:58 -0800
commit43f70eaea0e3fa9d98c895e9341674a67262b657 (patch)
treea68a7f742b4991fe10448b514e6e7767b1dcad43 /commit.c
parentf1bf54aee30c879b27602aa159264d5e9803c6b7 (diff)
refs/reftable: precompute prefix length
We're recomputing the prefix length on every iteration of the ref iterator. Precompute it for another speedup when iterating over 1 million refs: Benchmark 1: show-ref: single matching ref (revision = HEAD~) Time (mean ± σ): 100.3 ms ± 3.7 ms [User: 97.3 ms, System: 2.8 ms] Range (min … max): 97.5 ms … 139.7 ms 1000 runs Benchmark 2: show-ref: single matching ref (revision = HEAD) Time (mean ± σ): 95.8 ms ± 3.4 ms [User: 92.9 ms, System: 2.8 ms] Range (min … max): 93.0 ms … 121.9 ms 1000 runs Summary show-ref: single matching ref (revision = HEAD) ran 1.05 ± 0.05 times faster than show-ref: single matching ref (revision = HEAD~) Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions