Skip to content

Commit

Permalink
Add a performance test for git-grep
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Feb 17, 2012
1 parent 342e9ef commit 134593c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions t/perf/p7810-grep.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 134593c

Please sign in to comment.