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

[RFC PATCH 1/2] p7810: add more grep performance relevant cases

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Aug 4, 2019, 21:15 UTC
Message-ID
<20190804211509.39229-2-carenas@gmail.com>
In-Reply-To
<20190804211509.39229-1-carenas@gmail.com>

Add a baseline for a matching regex and make clear the distinction between fixed (now using kwset) and a real simple expression.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 t/perf/p7810-grep.sh | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/t/perf/p7810-grep.sh b/t/perf/p7810-grep.sh
index 9f4ade639f..9a4e335659 100755
--- a/t/perf/p7810-grep.sh
+++ b/t/perf/p7810-grep.sh
@@ -7,13 +7,34 @@ test_description="git-grep performance in various modes"
 test_perf_large_repo
 test_checkout_worktree
 
-test_perf 'grep worktree, cheap regex' '
+test_perf 'grep worktree, fixed regex (no match)' '
 	git grep some_nonexistent_string || :
 '
+test_perf 'grep worktree, fixed regex (common)' '
+	git grep void || :
+'
+test_perf 'grep -I, fixed non binary regex (common)' '
+	git grep -i void || :
+'
+test_perf 'grep -i, fixed caseless regex (common)' '
+	git grep -i void || :
+'
+test_perf 'grep --no-index, fixed regex (common)' '
+	git grep --no-index void || :
+'
+test_perf 'grep worktree, simple regex (common)' '
+	git grep "void|int" || :
+'
+test_perf 'grep -I, simple non binary regex (common)' '
+	git grep -I "void|int" || :
+'
+test_perf 'grep -i, simple caseless regex (common)' '
+	git grep -i "void|int" || :
+'
 test_perf 'grep worktree, expensive regex' '
 	git grep "^.* *some_nonexistent_string$" || :
 '
-test_perf 'grep --cached, cheap regex' '
+test_perf 'grep --cached, fixed regex' '
 	git grep --cached some_nonexistent_string || :
 '
 test_perf 'grep --cached, expensive regex' '
-- 
2.23.0.rc1
Previous: Carlo Marcelo Arenas BelónNext: Carlo Marcelo Arenas Belón
Message 2 of 4 in “grep: make threading smarter”
  1. 0/2 grep: make threading smarterCarlo Marcelo Arenas Belón, Aug 4, 2019
  2. 1/2 p7810: add more grep performance relevant casesCarlo Marcelo Arenas Belón, Aug 4, 2019
  3. 2/2 grep: make default number of threads reflect runtimeCarlo Marcelo Arenas Belón, Aug 4, 2019
  4. Junio C HamanoAug 5, 2019

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.