Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit ea97002

Browse files
peffgitster
authored andcommitted
t/perf: time rev-list with UNINTERESTING commits
We time a straight "rev-list --all" and its "--object" counterpart, both going all the way to the root. However, we do not time a partial history walk. This patch adds an extreme case: a walk over a very small slice of history, but with a very large set of UNINTERESTING tips. This is similar to the connectivity check run by git on a small fetch, or the walk done by any pre-receive hooks that want to check incoming commits. This test reveals a performance regression in git v1.8.4.2, caused by fbd4a70 (list-objects: mark more commits as edges in mark_edges_uninteresting, 2013-08-16): Test fbd4a70^ fbd4a70 ------------------------------------------------------------------------------------------ 0001.1: rev-list --all 0.69(0.67+0.02) 0.69(0.68+0.01) +0.0% 0001.2: rev-list --all --objects 3.47(3.44+0.02) 3.48(3.44+0.03) +0.3% 0001.4: rev-list $commit --not --all 0.04(0.04+0.00) 0.04(0.04+0.00) +0.0% 0001.5: rev-list --objects $commit --not --all 0.04(0.03+0.00) 0.27(0.24+0.02) +575.0% Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2f93541 commit ea97002

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/perf/p0001-rev-list.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,16 @@ test_perf 'rev-list --all --objects' '
1414
git rev-list --all --objects >/dev/null
1515
'
1616

17+
test_expect_success 'create new unreferenced commit' '
18+
commit=$(git commit-tree HEAD^{tree} -p HEAD)
19+
'
20+
21+
test_perf 'rev-list $commit --not --all' '
22+
git rev-list $commit --not --all >/dev/null
23+
'
24+
25+
test_perf 'rev-list --objects $commit --not --all' '
26+
git rev-list --objects $commit --not --all >/dev/null
27+
'
28+
1729
test_done

0 commit comments

Comments
 (0)