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

Re: [PATCH 1/2] t/perf: time rev-list with UNINTERESTING commits

From
Jeff King <peff@peff.net>
Date
Jan 20, 2014, 22:11 UTC
Message-ID
<20140120221142.GA24320@sigill.intra.peff.net>
In-Reply-To
<20140120213101.GA16095@sigill.intra.peff.net>
On Mon, Jan 20, 2014 at 04:31:01PM -0500, Jeff King wrote:
Show 16 quoted lines
> diff --git a/t/perf/p0001-rev-list.sh b/t/perf/p0001-rev-list.sh
> index 4f71a63..b7258a7 100755
> --- a/t/perf/p0001-rev-list.sh
> +++ b/t/perf/p0001-rev-list.sh
> @@ -14,4 +14,21 @@ test_perf 'rev-list --all --objects' '
>  	git rev-list --all --objects >/dev/null
>  '
>  
> +test_expect_success 'create new unreferenced commit' '
> +	git checkout --detach HEAD &&
> +	echo content >>file &&
> +	git add file &&
> +	git commit -m detached &&
> +	commit=$(git rev-parse --verify HEAD) &&
> +	git checkout -
> +'

This is bad to be touching the repo and assuming it is non-bare. For some reason I assumed that the perf suite made a copy of the repo, but it doesn't. If you point to a bare repo via GIT_PERF_REPO, this part of the test fails.

It's actually enough to demonstrate the problem without changing the tree at all. So this produces the same numbers, and works everywhere:

diff --git a/t/perf/p0001-rev-list.sh b/t/perf/p0001-rev-list.sh
index b7258a7..16359d5 100755
--- a/t/perf/p0001-rev-list.sh
+++ b/t/perf/p0001-rev-list.sh
@@ -15,12 +15,7 @@ test_perf 'rev-list --all --objects' '
 '
 
 test_expect_success 'create new unreferenced commit' '
-	git checkout --detach HEAD &&
-	echo content >>file &&
-	git add file &&
-	git commit -m detached &&
-	commit=$(git rev-parse --verify HEAD) &&
-	git checkout -
+	commit=$(git commit-tree HEAD^{tree} -p HEAD)
 '
 
 test_perf 'rev-list $commit --not --all' '

It still modifies the test repo, but at least in a fairly innocuous way.

-Peff
Previous: Jeff KingNext: Thomas Rast
Message 3 of 13 in “performance regression in mark_edges_uninteresting”
  1. 0/2 performance regression in mark_edges_uninterestingJeff King, Jan 20, 2014
  2. 1/2 t/perf: time rev-list with UNINTERESTING commitsJeff King, Jan 20, 2014
  3. Jeff KingJan 20, 2014
  4. Thomas RastJan 20, 2014
  5. Jeff KingJan 20, 2014
  6. 2/2 list-objects: only look at cmdline trees with edge_hintJeff King, Jan 20, 2014
  7. Duy NguyenJan 20, 2014
  8. Jeff KingJan 21, 2014
  9. Jeff KingJan 20, 2014
  10. 0/2 performance regression in mark_edges_uninterestingJeff King, Jan 21, 2014
  11. 1/2 t/perf: time rev-list with UNINTERESTING commitsJeff King, Jan 21, 2014
  12. 2/2 list-objects: only look at cmdline trees with edge_hintJeff King, Jan 21, 2014
  13. Junio C HamanoJan 21, 2014

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.