git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: [PATCH 1/2] t/perf: time rev-list with UNINTERESTING commits
Date: Mon, 20 Jan 2014 16:31:01 -0500	[thread overview]
Message-ID: <20140120213101.GA16095@sigill.intra.peff.net> (raw)
In-Reply-To: <20140120212845.GA11451@sigill.intra.peff.net>

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>
---
Sorry for the long lines in the commit message. I'm open to suggestions
on reformatting.

 t/perf/p0001-rev-list.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/t/perf/p0001-rev-list.sh b/t/perf/p0001-rev-list.sh
index 4f71a63..b7258a7 100755
--- a/t/perf/p0001-rev-list.sh
+++ b/t/perf/p0001-rev-list.sh
@@ -14,4 +14,21 @@ test_perf 'rev-list --all --objects' '
 	git rev-list --all --objects >/dev/null
 '
 
+test_expect_success 'create new unreferenced commit' '
+	git checkout --detach HEAD &&
+	echo content >>file &&
+	git add file &&
+	git commit -m detached &&
+	commit=$(git rev-parse --verify HEAD) &&
+	git checkout -
+'
+
+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
-- 
1.8.5.2.500.g8060133

  reply	other threads:[~2014-01-20 21:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 21:28 [PATCH 0/2] performance regression in mark_edges_uninteresting Jeff King
2014-01-20 21:31 ` Jeff King [this message]
2014-01-20 22:11   ` [PATCH 1/2] t/perf: time rev-list with UNINTERESTING commits Jeff King
2014-01-20 22:32     ` Thomas Rast
2014-01-20 22:39       ` Jeff King
2014-01-20 21:32 ` [PATCH 2/2] list-objects: only look at cmdline trees with edge_hint Jeff King
2014-01-20 23:57   ` Duy Nguyen
2014-01-21  2:22     ` Jeff King
2014-01-20 22:29 ` [PATCH 0/2] performance regression in mark_edges_uninteresting Jeff King
2014-01-21  2:24 ` [PATCH v2 " Jeff King
2014-01-21  2:25   ` [PATCH v2 1/2] t/perf: time rev-list with UNINTERESTING commits Jeff King
2014-01-21  2:25   ` [PATCH v2 2/2] list-objects: only look at cmdline trees with edge_hint Jeff King
2014-01-21 22:49     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140120213101.GA16095@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).