summaryrefslogtreecommitdiff
path: root/t/perf/p7810-grep.sh
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2012-02-17 10:25:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-17 16:21:34 (GMT)
commit134593c8ca1866bfbb0c63506f350ce9868fd7e5 (patch)
tree3c9c5d85437772b38cf7b75f8c56097f1a907672 /t/perf/p7810-grep.sh
parent342e9ef2d9ecc802191ef62a51f4e7db2ede41b1 (diff)
downloadgit-134593c8ca1866bfbb0c63506f350ce9868fd7e5.zip
git-134593c8ca1866bfbb0c63506f350ce9868fd7e5.tar.gz
git-134593c8ca1866bfbb0c63506f350ce9868fd7e5.tar.bz2
Add a performance test for git-grep
The only catch is that we don't really know what our repo contains, so we have to ignore any possible "not found" status from git-grep. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/perf/p7810-grep.sh')
-rwxr-xr-xt/perf/p7810-grep.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/perf/p7810-grep.sh b/t/perf/p7810-grep.sh
new file mode 100755
index 0000000..9f4ade6
--- /dev/null
+++ b/t/perf/p7810-grep.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+test_description="git-grep performance in various modes"
+
+. ./perf-lib.sh
+
+test_perf_large_repo
+test_checkout_worktree
+
+test_perf 'grep worktree, cheap regex' '
+ git grep some_nonexistent_string || :
+'
+test_perf 'grep worktree, expensive regex' '
+ git grep "^.* *some_nonexistent_string$" || :
+'
+test_perf 'grep --cached, cheap regex' '
+ git grep --cached some_nonexistent_string || :
+'
+test_perf 'grep --cached, expensive regex' '
+ git grep --cached "^.* *some_nonexistent_string$" || :
+'
+
+test_done