From: Thomas Rast Date: Fri, 17 Feb 2012 10:25:10 +0000 (+0100) Subject: Add a performance test for git-grep X-Git-Tag: v1.7.10-rc0~56^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=134593c8ca1866bfbb0c63506f350ce9868fd7e5;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/t/perf/p7810-grep.sh b/t/perf/p7810-grep.sh new file mode 100755 index 000000000..9f4ade639 --- /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