summaryrefslogtreecommitdiff
path: root/t/perf/p0001-rev-list.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-01-21 02:25:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-21 22:46:17 (GMT)
commitea97002fc9f682a804ac05212d069e38fa3e365c (patch)
tree47be7f758d998a9f4b455eb9a17f2a89f16d6627 /t/perf/p0001-rev-list.sh
parent2f93541d88fadd1ff5307d81c2c8921ee3eea058 (diff)
downloadgit-ea97002fc9f682a804ac05212d069e38fa3e365c.zip
git-ea97002fc9f682a804ac05212d069e38fa3e365c.tar.gz
git-ea97002fc9f682a804ac05212d069e38fa3e365c.tar.bz2
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 fbd4a703^ fbd4a703 ------------------------------------------------------------------------------------------ 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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/perf/p0001-rev-list.sh')
-rwxr-xr-xt/perf/p0001-rev-list.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/perf/p0001-rev-list.sh b/t/perf/p0001-rev-list.sh
index 4f71a63..16359d5 100755
--- a/t/perf/p0001-rev-list.sh
+++ b/t/perf/p0001-rev-list.sh
@@ -14,4 +14,16 @@ test_perf 'rev-list --all --objects' '
git rev-list --all --objects >/dev/null
'
+test_expect_success 'create new unreferenced commit' '
+ commit=$(git commit-tree HEAD^{tree} -p HEAD)
+'
+
+test_perf 'rev-list $commit --not --all' '
+ git rev-list $commit --not --all >/dev/null
+'
+
+test_perf 'rev-list --objects $commit --not --all' '
+ git rev-list --objects $commit --not --all >/dev/null
+'
+
test_done