git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 3/3] p0003-index.sh: add perf test for the index formats

From
Thomas Gummerer <t.gummerer@gmail.com>
Date
Sep 23, 2013, 21:08 UTC
Message-ID
<1379970526-27997-4-git-send-email-t.gummerer@gmail.com>
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
Previous: Thomas Gummerer
Message 12 of 12 in “perf-lib: split starting the test from the execution”
  1. 1/2 perf-lib: split starting the test from the executionThomas Gummerer, Sep 17, 2013
  2. 2/2 perf-lib: add test_perf_cleanup targetThomas Gummerer, Sep 17, 2013
  3. Junio C HamanoSep 17, 2013
  4. Thomas GummererSep 19, 2013
  5. Junio C HamanoSep 19, 2013
  6. Junio C HamanoSep 19, 2013
  7. Junio C HamanoSep 19, 2013
  8. Thomas GummererSep 20, 2013
  9. 0/3 Add cleanup action to perf-libThomas Gummerer, Sep 23, 2013
  10. 1/3 test-lib: introduce "modern" style testsThomas Gummerer, Sep 23, 2013
  11. 2/3 perf-lib: add cleanup optionThomas Gummerer, Sep 23, 2013
  12. 3/3 p0003-index.sh: add perf test for the index formatsThomas Gummerer, Sep 23, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.