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

Re: [PATCH v2 6/7] p5326: generate pack bitmaps before writing the MIDX bitmap

From
Jeff King <peff@peff.net>
Date
Sep 16, 2021, 22:45 UTC
Message-ID
<YUPJDf7u8Nn5als3@coredump.intra.peff.net>
In-Reply-To
<040bb40548017bae807c1d349fa078c21ac46725.1631657157.git.me@ttaylorr.com>
On Tue, Sep 14, 2021 at 06:06:14PM -0400, Taylor Blau wrote:
Show 9 quoted lines
> To help test the performance of permuting the contents of the hash-cache
> when generating a MIDX bitmap, we need a bitmap which has its hash-cache
> populated.
> 
> And since multi-pack bitmaps don't add *new* values to the hash-cache,
> we have to rely on a single-pack bitmap to generate those values for us.
> 
> Therefore, generate a pack bitmap before the MIDX one in order to ensure
> that the MIDX bitmap has entries in its hash-cache.

Makes sense. This is a little more contrived of a setup than the original, but an utterly realistic one. If you are using midx bitmaps, you are probably interspersing them with occasional full pack bitmaps.

It might be interesting to also do:
  rm -f .git/objects/pack/pack-*.bitmap

after generating the midx bitmap. That would confirm the further timing tests are using the midx bitmap, and not ever "cheating" by looking at the pack one (having poked in this direction before, I know that this all works, so it would be a future-proofing thing).

Show 12 quoted lines
> diff --git a/t/perf/p5326-multi-pack-bitmaps.sh b/t/perf/p5326-multi-pack-bitmaps.sh
> index a9c5499537..38557859b7 100755
> --- a/t/perf/p5326-multi-pack-bitmaps.sh
> +++ b/t/perf/p5326-multi-pack-bitmaps.sh
> @@ -13,7 +13,7 @@ test_expect_success 'create tags' '
>  '
>  
>  test_perf 'setup multi-pack index' '
> -	git repack -ad &&
> +	git repack -adb &&
>  	git multi-pack-index write --bitmap
>  '

This sort-of existed before your series, but I think is a bit "worse" now: we are timing both "repack" and "multi-pack-index" write together. So:

  - the timing for the midx write that we are interested in timing will
    be diluted by the much-bigger full-repack
  - we'll actually do _three_ full repacks (the default
    GIT_PERF_REPEAT_COUNT for the "run" script), since it's inside a
    test_perf()
So:
  test_expect_success 'start with bitmapped pack' '
	git repack -adb
  '
  test_perf 'setup multi-pack index' '
	git multi-pack-index write --bitmap
  '

would run faster and give us more interesting timings. Possibly you'd want to drop the midx and its bitmaps as part of that test_perf, too. The first run will be using the pack bitmap, and the others will use the midx. I doubt it makes much difference either way, though.

And of course if you want to take my earlier suggestion, then it's easy to add:

  test_expect_success 'drop pack bitmap' '
	rm -f .git/objects/pack/pack-*.bitmap
  '

afterwards; you wouldn't want to do it inside the test_perf() call because of the repeat-count.

-Peff
Previous: Taylor BlauNext: Taylor Blau
Message 42 of 55 in “pack-bitmap: permute existing namehash values”
  1. 0/4 pack-bitmap: permute existing namehash valuesTaylor Blau, Sep 7, 2021
  2. 1/4 t/helper/test-bitmap.c: add 'dump-hashes' modeTaylor Blau, Sep 7, 2021
  3. Ævar Arnfjörð BjarmasonSep 8, 2021
  4. Taylor BlauSep 8, 2021
  5. 2/4 pack-bitmap.c: propagate namehash values from existing bitmapsTaylor Blau, Sep 7, 2021
  6. 3/4 midx.c: respect 'pack.writeBitmapHashcache' when writing bitmapsTaylor Blau, Sep 7, 2021
  7. Ævar Arnfjörð BjarmasonSep 8, 2021
  8. Taylor BlauSep 8, 2021
  9. Ævar Arnfjörð BjarmasonSep 9, 2021
  10. Ævar Arnfjörð BjarmasonSep 9, 2021
  11. Taylor BlauSep 9, 2021
  12. Ævar Arnfjörð BjarmasonSep 9, 2021
  13. Taylor BlauSep 9, 2021
  14. Taylor BlauSep 9, 2021
  15. Junio C HamanoSep 13, 2021
  16. Taylor BlauSep 14, 2021
  17. 4/4 t5326: test propagating hashcache valuesTaylor Blau, Sep 7, 2021
  18. Ævar Arnfjörð BjarmasonSep 8, 2021
  19. Taylor BlauSep 8, 2021
  20. Ævar Arnfjörð BjarmasonSep 17, 2021
  21. Taylor BlauSep 17, 2021
  22. Ævar Arnfjörð BjarmasonSep 17, 2021
  23. Junio C HamanoSep 13, 2021
  24. Taylor BlauSep 14, 2021
  25. Junio C HamanoSep 14, 2021
  26. Taylor BlauSep 14, 2021
  27. Taylor BlauSep 14, 2021
  28. Jeff KingSep 14, 2021
  29. Taylor BlauSep 14, 2021
  30. Jeff KingSep 14, 2021
  31. Junio C HamanoSep 14, 2021
  32. 0/7 pack-bitmap: permute existing namehash valuesTaylor Blau, Sep 14, 2021
  33. 1/7 t/helper/test-bitmap.c: add 'dump-hashes' modeTaylor Blau, Sep 14, 2021
  34. 2/7 pack-bitmap.c: propagate namehash values from existing bitmapsTaylor Blau, Sep 14, 2021
  35. 3/7 midx.c: respect 'pack.writeBitmapHashcache' when writing bitmapsTaylor Blau, Sep 14, 2021
  36. 4/7 p5326: create missing 'perf-tag' tagTaylor Blau, Sep 14, 2021
  37. Jeff KingSep 16, 2021
  38. Taylor BlauSep 17, 2021
  39. 5/7 p5326: don't set core.multiPackIndex unnecessarilyTaylor Blau, Sep 14, 2021
  40. Jeff KingSep 16, 2021
  41. 6/7 p5326: generate pack bitmaps before writing the MIDX bitmapTaylor Blau, Sep 14, 2021
  42. Jeff KingSep 16, 2021
  43. Taylor BlauSep 17, 2021
  44. 7/7 t5326: test propagating hashcache valuesTaylor Blau, Sep 14, 2021
  45. Jeff KingSep 16, 2021
  46. Jeff KingSep 16, 2021
  47. 0/7 pack-bitmap: permute existing namehash valuesTaylor Blau, Sep 17, 2021
  48. 1/7 t/helper/test-bitmap.c: add 'dump-hashes' modeTaylor Blau, Sep 17, 2021
  49. 2/7 pack-bitmap.c: propagate namehash values from existing bitmapsTaylor Blau, Sep 17, 2021
  50. 3/7 midx.c: respect 'pack.writeBitmapHashcache' when writing bitmapsTaylor Blau, Sep 17, 2021
  51. 4/7 p5326: create missing 'perf-tag' tagTaylor Blau, Sep 17, 2021
  52. 5/7 p5326: don't set core.multiPackIndex unnecessarilyTaylor Blau, Sep 17, 2021
  53. 6/7 p5326: generate pack bitmaps before writing the MIDX bitmapTaylor Blau, Sep 17, 2021
  54. 7/7 t5326: test propagating hashcache valuesTaylor Blau, Sep 17, 2021
  55. Jeff KingSep 17, 2021

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.