git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gummerer <t.gummerer@gmail.com>
To: gitster@pobox.com
Cc: trast@inf.ethz.ch, git@vger.kernel.org, t.gummerer@gmail.com
Subject: [PATCH v2 3/3] p0003-index.sh: add perf test for the index formats
Date: Mon, 23 Sep 2013 23:08:46 +0200	[thread overview]
Message-ID: <1379970526-27997-4-git-send-email-t.gummerer@gmail.com> (raw)
In-Reply-To: <1379970526-27997-1-git-send-email-t.gummerer@gmail.com>

From: Thomas Rast <trast@inf.ethz.ch>

Add a performance test for index version [23]/4 by using
git update-index --index-version=x, thus testing both the reader
and the writer speed of all index formats.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
---
 t/perf/p0003-index.sh | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100755 t/perf/p0003-index.sh

diff --git a/t/perf/p0003-index.sh b/t/perf/p0003-index.sh
new file mode 100755
index 0000000..f2308c0
--- /dev/null
+++ b/t/perf/p0003-index.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+test_description="Tests index versions [23]/4/5"
+
+. ./perf-lib.sh
+
+test_perf_large_repo
+test_checkout_worktree
+
+test_expect_success "convert to v3" "
+	git update-index --index-version=2
+"
+subdir=$(git ls-files | sed 's#/[^/]*$##' | grep -v '^$' | uniq | tail -n 30 | head -1)
+file=$(git ls-files | tail -n 100 | head -1)
+
+test_expect_success "modify a file" "
+	echo 'foo bar' >>$file
+"
+
+test_perf "v[23]: update-index" "
+	git update-index --index-version=2 >/dev/null
+"
+
+test_perf "v[23]: grep nonexistent -- subdir" "
+	test_must_fail git grep nonexistent -- $subdir >/dev/null
+"
+
+test_perf "v[23]: ls-files -- subdir" "
+	git ls-files $subdir >/dev/null
+"
+
+test_perf --cleanup "git reset" "v[23]: update-index -- file" "
+	git update-index $file
+"
+
+test_expect_success "convert to v4" "
+	git update-index --index-version=4
+"
+
+test_perf "v4: update-index" "
+	git update-index --index-version=4 >/dev/null
+"
+
+test_perf "v4: grep nonexistent -- subdir" "
+	test_must_fail git grep nonexistent -- $subdir >/dev/null
+"
+
+test_perf "v4: ls-files -- subdir" "
+	git ls-files $subdir >/dev/null
+"
+
+test_perf --cleanup "git reset" "v4: update-index -- file" "
+	git update-index $file
+"
+
+test_done
-- 
1.8.3.4.1241.g1ce9896

      parent reply	other threads:[~2013-09-23 21:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17 12:10 [PATCH 1/2] perf-lib: split starting the test from the execution Thomas Gummerer
2013-09-17 12:10 ` [PATCH 2/2] perf-lib: add test_perf_cleanup target Thomas Gummerer
2013-09-17 17:43   ` Junio C Hamano
2013-09-19 11:42     ` Thomas Gummerer
2013-09-19 17:19       ` Junio C Hamano
2013-09-19 19:52         ` Junio C Hamano
2013-09-19 20:11           ` Junio C Hamano
2013-09-20 22:14           ` Thomas Gummerer
2013-09-23 21:08           ` [PATCH v2 0/3] Add cleanup action to perf-lib Thomas Gummerer
2013-09-23 21:08             ` [PATCH v2 1/3] test-lib: introduce "modern" style tests Thomas Gummerer
2013-09-23 21:08             ` [PATCH v2 2/3] perf-lib: add cleanup option Thomas Gummerer
2013-09-23 21:08             ` Thomas Gummerer [this message]

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=1379970526-27997-4-git-send-email-t.gummerer@gmail.com \
    --to=t.gummerer@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=trast@inf.ethz.ch \
    /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).