From: Thomas Rast <trast@student.ethz.ch>
To: <git@vger.kernel.org>
Cc: Michael Haggerty <mhagger@alum.mit.edu>
Subject: [RFC PATCH 4/4] Add a performance test for git-grep
Date: Wed, 14 Dec 2011 16:23:32 +0100 [thread overview]
Message-ID: <370de2c5c277513098480baf47f73ca6077787b0.1323876121.git.trast@student.ethz.ch> (raw)
In-Reply-To: <cover.1323876121.git.trast@student.ethz.ch>
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>
---
t/perf/p7810-grep.sh | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
create mode 100755 t/perf/p7810-grep.sh
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
--
1.7.8.304.ge42e4
prev parent reply other threads:[~2011-12-14 15:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-14 15:23 [RFC PATCH 0/4] Performance test framework Thomas Rast
2011-12-14 15:23 ` [RFC PATCH 1/4] Move the user-facing test library to test-lib-functions.sh Thomas Rast
2011-12-14 15:23 ` [RFC PATCH 2/4] test-lib: allow testing another git build tree Thomas Rast
2011-12-15 3:07 ` Junio C Hamano
2011-12-15 10:33 ` Thomas Rast
2011-12-15 19:05 ` Junio C Hamano
2011-12-14 15:23 ` [RFC PATCH 3/4] Introduce a performance testing framework Thomas Rast
2011-12-14 16:04 ` Thomas Rast
2011-12-14 15:23 ` Thomas Rast [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=370de2c5c277513098480baf47f73ca6077787b0.1323876121.git.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=git@vger.kernel.org \
--cc=mhagger@alum.mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).