From: Thomas Gummerer Date: Wed, 27 Nov 2013 12:00:54 GMT Subject: [PATCH v4 19/24] p0003-index.sh: add perf test for the index formats Message-ID: <1385553659-9928-20-git-send-email-t.gummerer@gmail.com> In-Reply-To: <1385553659-9928-1-git-send-email-t.gummerer@gmail.com> From: Thomas Rast Add a performance test for index version [23]/4/5 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 Signed-off-by: Thomas Gummerer --- t/perf/p0003-index.sh | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 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..5360175 --- /dev/null +++ b/t/perf/p0003-index.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +test_description="Tests index versions [23]/4/5" + +. ./perf-lib.sh + +test_perf_large_repo + +test_expect_success "convert to v3" " + git update-index --index-version=2 +" + +test_perf "v[23]: update-index" " + git update-index --index-version=2 >/dev/null +" + +subdir=$(git ls-files | sed 's#/[^/]*$##' | grep -v '^$' | uniq | tail -n 30 | head -1) + +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_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_expect_success "convert to v5" " + git update-index --index-version=5 +" + +test_perf "v5: update-index" " + git update-index --index-version=5 >/dev/null +" + +test_perf "v5: ls-files" " + git ls-files >/dev/null +" + +test_perf "v5: grep nonexistent -- subdir" " + test_must_fail git grep nonexistent -- $subdir >/dev/null +" + +test_perf "v5: ls-files -- subdir" " + git ls-files $subdir >/dev/null +" + +test_done -- 1.8.4.2