git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 3/3] Add a performance test for git-grep

From
Thomas Rast <trast@student.ethz.ch>
Date
Feb 17, 2012, 10:25 UTC
Message-ID
<95250e73e5610f8415fa0c6a3527b067ec0f75f2.1329472405.git.trast@student.ethz.ch>
In-Reply-To
<cover.1329472405.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 file changed, 23 insertions(+)
 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.9.1.365.ge223f
Previous: Thomas RastNext: Junio C Hamano
Message 8 of 19 in “Adding a performance framework”
  1. 0/3 Adding a performance frameworkThomas Rast, Feb 16, 2012
  2. 1/3 Move the user-facing test library to test-lib-functions.shThomas Rast, Feb 16, 2012
  3. Junio C HamanoFeb 16, 2012
  4. Thomas RastFeb 17, 2012
  5. 0/3 Thomas Rast, Feb 17, 2012
  6. 1/3 Move the user-facing test library to test-lib-functions.shThomas Rast, Feb 17, 2012
  7. 2/3 Introduce a performance testing frameworkThomas Rast, Feb 17, 2012
  8. 3/3 Add a performance test for git-grepThomas Rast, Feb 17, 2012
  9. Junio C HamanoFeb 17, 2012
  10. Junio C HamanoFeb 17, 2012
  11. Jeff KingFeb 18, 2012
  12. Junio C HamanoFeb 18, 2012
  13. Jeff KingFeb 18, 2012
  14. SIGPIPE handling (Re: [PATCH v3 0/3])Jonathan Nieder, Feb 18, 2012
  15. Jonathan NiederFeb 18, 2012
  16. Jeff KingFeb 18, 2012
  17. 2/3 Introduce a performance testing frameworkThomas Rast, Feb 16, 2012
  18. Jeff KingFeb 17, 2012
  19. 3/3 Add a performance test for git-grepThomas Rast, Feb 16, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.