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

Re: [PATCH v2 2/2] perf: add test showing exponential growth in path globbing

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 10, 2017, 23:33 UTC
Message-ID
<20170510233311.GE28740@aiede.svl.corp.google.com>
In-Reply-To
<20170510225316.31680-3-avarab@gmail.com>
Hi,
Ævar Arnfjörð Bjarmason wrote:
> Add a test showing that ls-files times grow exponentially in the face
> of some pathological globs, whereas refglobs via for-each-ref don't in
> practice suffer from the same issue.
Cool.
[...]
Show 9 quoted lines
> --- /dev/null
> +++ b/t/perf/p0100-globbing.sh
> @@ -0,0 +1,48 @@
> +#!/bin/sh
> +
> +test_description="Tests pathalogical globbing performance
> +
> +Shows how Git's globbing performance performs when given the sort of
> +pathalogical patterns described in at https://research.swtch.com/glob
s/pathalogical/pathological/
Show 23 quoted lines
> +"
> +
> +. ./perf-lib.sh
> +
> +test_globs_big='10 25 50 75 100'
> +test_globs_small='1 2 3 4 5 6'
> +
> +test_perf_fresh_repo
> +
> +test_expect_success 'setup' '
> +	for i in $(test_seq 1 100)
> +	do
> +		printf "a" >>refname &&
> +		for j in $(test_seq 1 $i)
> +		do
> +			printf "a*" >>refglob.$i
> +		done &&
> +		echo b >>refglob.$i
> +	done &&
> +	test_commit $(cat refname) &&
> +	for i in $(test_seq 1 100)
> +	do
> +	echo	git tag $(cat refname)-$i
Leftover echo from debugging?
Show 17 quoted lines
> +	done &&
> +	test_commit hello
> +'
> +
> +for i in $test_globs_big
> +do
> +	test_perf "refglob((a*)^nb) against tag a^100; n = $i" '
> +		git for-each-ref "refs/tags/$(cat refglob.'$i')b"
> +	'
> +done
> +
> +for i in $test_globs_small
> +do
> +	test_perf "fileglob((a*)^nb) against file (a^100).t; n = $i" '
> +		git ls-files "$(cat refglob.'$i')b"
> +	'
> +done
The rest looks sensible.

Thanks, Jonathan

Previous: Ævar Arnfjörð Bjarmason
Message 9 of 9 in “perf: show that wildmatch() regressed for pathological cases in v2.0”
  1. 0/2 perf: show that wildmatch() regressed for pathological cases in v2.0Ævar Arnfjörð Bjarmason, May 10, 2017
  2. 1/2 perf: add function to setup a fresh test repoÆvar Arnfjörð Bjarmason, May 10, 2017
  3. Jonathan NiederMay 10, 2017
  4. Ævar Arnfjörð BjarmasonMay 11, 2017
  5. Junio C HamanoMay 11, 2017
  6. Junio C HamanoMay 11, 2017
  7. Ævar Arnfjörð BjarmasonMay 11, 2017
  8. 2/2 perf: add test showing exponential growth in path globbingÆvar Arnfjörð Bjarmason, May 10, 2017
  9. Jonathan NiederMay 10, 2017

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.