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

Re: [PATCH 8/8] perf: add tests for tag --contains

From
Jeff King <peff@peff.net>
Date
Jun 26, 2014, 00:01 UTC
Message-ID
<20140626000129.GA25028@sigill.intra.peff.net>
In-Reply-To
<20140625235335.GH23146@sigill.intra.peff.net>
On Wed, Jun 25, 2014 at 07:53:35PM -0400, Jeff King wrote:
> There are still two things about the timings that puzzle me a bit.
<forehead-palm>
This certainly isn't helping:
Show 5 quoted lines
> +test_expect_success 'find reference points' '
> +	recent=$(git rev-parse HEAD~100) &&
> +	old=$(git rev-parse HEAD~5000) &&
> +	ancient=$(git rev-list | tail -n 1)
> +'
$ancient will always be empty, as rev-list needs a "HEAD" argument.

I also think HEAD~100 is probably _too_ recent, as it is not enough to match any tags at all right now.

So with this patch:
diff --git a/t/perf/p7000-tag-contains.sh b/t/perf/p7000-tag-contains.sh
index 846f106..8294d41 100755
--- a/t/perf/p7000-tag-contains.sh
+++ b/t/perf/p7000-tag-contains.sh
@@ -6,9 +6,9 @@ test_description='speed of tag --contains lookups'
 test_perf_default_repo
 
 test_expect_success 'find reference points' '
-	recent=$(git rev-parse HEAD~100) &&
+	recent=$(git rev-parse HEAD~200) &&
 	old=$(git rev-parse HEAD~5000) &&
-	ancient=$(git rev-list | tail -n 1)
+	ancient=$(git rev-list HEAD | tail -n 1)
 '
 
 test_expect_success 'find most recent tag' '

I get:

  Test                              ffc4b80^          origin/master             HEAD                  
  ----------------------------------------------------------------------------------------------------
  7000.3: contains recent/all       1.99(1.97+0.01)   0.25(0.24+0.00) -87.4%    0.27(0.26+0.00) -86.4%
  7000.4: contains recent/v2.0.1    0.03(0.03+0.00)   0.00(0.00+0.00) -100.0%   0.03(0.02+0.00) +0.0% 
  7000.5: contains old/all          0.90(0.89+0.00)   0.18(0.17+0.00) -80.0%    0.27(0.26+0.00) -70.0%
  7000.6: contains old/v2.0.1       0.25(0.24+0.00)   0.03(0.03+0.00) -88.0%    0.25(0.24+0.00) +0.0% 
  7000.7: contains ancient/all      0.82(0.80+0.01)   0.13(0.12+0.00) -84.1%    0.27(0.26+0.01) -67.1%
  7000.8: contains ancient/v2.0.1   0.26(0.26+0.00)   0.09(0.08+0.00) -65.4%    0.25(0.24+0.00) -3.8% 

which looks about right.

-Peff
Previous: Jeff KingNext: Jeff King
Message 25 of 26 in “use merge-base for tag --contains”
  1. 0/8 use merge-base for tag --containsJeff King, Jun 25, 2014
  2. 1/8 tag: allow --sort with -nJeff King, Jun 25, 2014
  3. 2/8 tag: factor out decision to stream tagsJeff King, Jun 25, 2014
  4. 3/8 paint_down_to_common: use prio_queueJeff King, Jun 25, 2014
  5. Junio C HamanoJul 1, 2014
  6. Jeff KingJul 1, 2014
  7. 4/8 add functions for memory-efficient bitmapsJeff King, Jun 25, 2014
  8. Torsten BögershausenJun 26, 2014
  9. Jeff KingJun 26, 2014
  10. Eric SunshineJun 29, 2014
  11. Jeff KingJun 30, 2014
  12. Junio C HamanoJul 1, 2014
  13. Jeff KingJul 1, 2014
  14. 5/8 string-list: add pos to iterator callbackJeff King, Jun 25, 2014
  15. Junio C HamanoJul 1, 2014
  16. Jeff KingJul 1, 2014
  17. 6/8 commit: provide a fast multi-tip contains functionJeff King, Jun 25, 2014
  18. Junio C HamanoJun 26, 2014
  19. Junio C HamanoJun 26, 2014
  20. Junio C HamanoJun 26, 2014
  21. Junio C HamanoJul 1, 2014
  22. Junio C HamanoJul 1, 2014
  23. 7/8 tag: use commit_containsJeff King, Jun 25, 2014
  24. 8/8 perf: add tests for tag --containsJeff King, Jun 25, 2014
  25. Jeff KingJun 26, 2014
  26. Jeff KingJun 26, 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.