summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 342e9ef)
raw | patch | inline | side by side (parent: 342e9ef)
author | Thomas Rast <trast@student.ethz.ch> | |
Fri, 17 Feb 2012 10:25:10 +0000 (11:25 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 17 Feb 2012 16:21:34 +0000 (08:21 -0800) |
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>
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>
t/perf/p7810-grep.sh | [new file with mode: 0755] | patch | blob |
diff --git a/t/perf/p7810-grep.sh b/t/perf/p7810-grep.sh
--- /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