path: root/t/perf/
diff options
authorThomas Rast <>2012-02-17 10:25:09 (GMT)
committerJunio C Hamano <>2012-02-17 16:21:22 (GMT)
commit342e9ef2d9ecc802191ef62a51f4e7db2ede41b1 (patch)
tree6c8727ca9081504a26ff4a1009f9228d7dd5a98f /t/perf/
parent12a29b1a50d47594eb3a29003e3f1eb540580aaa (diff)
Introduce a performance testing framework
This introduces a performance testing framework under t/perf/. It tries to be as close to the infrastructure as possible, and thus should be easy to get used to for git developers. The following points were considered for the implementation: 1. You usually want to compare arbitrary revisions/build trees against each other. They may not have the performance test under consideration, or even the infrastructure. To cope with this, the 'run' script lets you specify arbitrary build dirs and revisions. It even automatically builds the revisions if it doesn't have them at hand yet. 2. Usually you would not want to run all tests. It would take too long anyway. The 'run' script lets you specify which tests to run; or you can also do it manually. There is a Makefile for discoverability and 'make clean', but it is not meant for real-world use. 3. Creating test repos from scratch in every test is extremely time-consuming, and shipping or downloading such large/weird repos is out of the question. We leave this decision to the user. Two different sizes of test repos can be configured, and the scripts just copy one or more of those (using hardlinks for the object store). By default it tries to use the build tree's git.git repository. This is fairly fast and versatile. Using a copy instead of a clone preserves many properties that the user may want to test for, such as lots of loose objects, unpacked refs, etc. Signed-off-by: Thomas Rast <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/perf/')
1 files changed, 41 insertions, 0 deletions
diff --git a/t/perf/ b/t/perf/
new file mode 100755
index 0000000..2ca4aac
--- /dev/null
+++ b/t/perf/
@@ -0,0 +1,41 @@
+test_description='Tests whether perf-lib facilities work'
+. ./
+test_perf 'test_perf_default_repo works' '
+ foo=$(git rev-parse HEAD) &&
+ test_export foo
+test_perf 'test_checkout_worktree works' '
+ wt=$(find . | wc -l) &&
+ idx=$(git ls-files | wc -l) &&
+ test $wt -gt $idx
+test_export baz
+test_expect_success 'test_export works' '
+ echo "$foo" &&
+ test "$foo" = "$(git rev-parse HEAD)" &&
+ echo "$baz" &&
+ test "$baz" = baz
+test_perf 'export a weird var' '
+ bar="weird # variable" &&
+ test_export bar
+test_expect_success 'test_export works with weird vars' '
+ echo "$bar" &&
+ test "$bar" = "weird # variable"