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

Re: [PATCH 0/3] pack-bitmap: boundary-based bitmap traversal

From
Taylor Blau <me@ttaylorr.com>
Date
Apr 25, 2023, 18:57 UTC
Message-ID
<ZEgikbdP8M2sDMlM@nand.local>
In-Reply-To
<1a09d246-5750-7d98-08f7-bad6d3dee3c9@github.com>
On Tue, Apr 25, 2023 at 02:30:01PM -0400, Derrick Stolee wrote:
Show 20 quoted lines
> On 4/25/2023 2:02 PM, Junio C Hamano wrote:
> > Taylor Blau <me@ttaylorr.com> writes:
> >
> >> This improves many cases where using bitmaps was significantly *slower*
> >> than regular, non-bitmap traversal. In some instances, using bitmaps is
> >> still slower than the non-bitmap case, but it is a substantial
> >> improvement over the classic bitmap walk.
> >> ...
> >> In a large repository on GitHub.com, the timings to compute the objects
> >> unique to "master", as in:
> >>
> >>     $ git rev-list --count --objects master --not --exclude=master --branches
> >>
> >> improve as follows:
> >
> > Curious---when would it be significantly faster to use bitmaps?
> > "Most of the time"?  "In not-too-large repository?"
>
> This is an interesting question that is very difficult to predict
> in advance.
Indeed ;-).
> It would be interesting if we used the initial commit walk to the
> boundary as a predictor of whether bitmaps would be good, or if
> we should use the tree-parsing walk instead.

I think that this is tough, too. When making a prediction, it would be good if we could avoid walking down to the nearest bitmap, since by that point, you might as well have used bitmaps (if you found one before reaching the root(s) of history).

I think the best heuristic we have available is if we have is something like "# of UNINTERESTING commits between the tips and boundary", since we OR those in ahead of time, and then the fill-in traversal will (usually, not always) be cheap.

But I think that heuristic probably isn't too predictive, since it would often give you the wrong prediction, say, when there are no UNINTERESTING commits between the tips and boundary, but the boundary is bitmapped.

Another approach you could take is to cut off the fill-in traversal at some point, or start with whichever is presumed to be faster and then dynamically switch to the other at some point during the walk. But that also depends on repository shape/size, and machine configuration.

So I think it's extremely difficult to get "right", but if others have suggestions, I would certainly be receptive to them :-).

> But perhaps this series gets the bitmap walk "close enough" in
> the typical case that it's better to use bitmaps in the chance that
> we have accidentally hit a case where we'd normally need to walk a
> lot of trees.

Yeah, that is definitely part of this series's goal. Another framing is, for configurations that are using bitmaps everywhere, this should reduce the number of cases where using bitmaps is *significantly* slower than not.

Thanks, Taylor

Previous: Derrick StoleeNext: Derrick Stolee
Message 22 of 51 in “pack-bitmap: boundary-based bitmap traversal”
  1. 0/3 pack-bitmap: boundary-based bitmap traversalTaylor Blau, Apr 25, 2023
  2. 1/3 revision: support tracking uninteresting commitsTaylor Blau, Apr 25, 2023
  3. Derrick StoleeApr 25, 2023
  4. Taylor BlauMay 3, 2023
  5. Derrick StoleeMay 4, 2023
  6. Taylor BlauMay 3, 2023
  7. Derrick StoleeMay 4, 2023
  8. Taylor BlauMay 5, 2023
  9. Junio C HamanoApr 25, 2023
  10. Taylor BlauApr 25, 2023
  11. 2/3 pack-bitmap.c: extract `fill_in_bitmap()`Taylor Blau, Apr 25, 2023
  12. Junio C HamanoApr 25, 2023
  13. Taylor BlauApr 25, 2023
  14. 3/3 pack-bitmap.c: use commit boundary during bitmap traversalTaylor Blau, Apr 25, 2023
  15. Junio C HamanoApr 25, 2023
  16. Felipe ContrerasMay 2, 2023
  17. Taylor BlauMay 3, 2023
  18. Junio C HamanoMay 3, 2023
  19. Derrick StoleeApr 25, 2023
  20. Junio C HamanoApr 25, 2023
  21. Derrick StoleeApr 25, 2023
  22. Taylor BlauApr 25, 2023
  23. Derrick StoleeApr 25, 2023
  24. Taylor BlauMay 3, 2023
  25. Derrick StoleeApr 25, 2023
  26. Taylor BlauApr 25, 2023
  27. Derrick StoleeApr 25, 2023
  28. Junio C HamanoMay 1, 2023
  29. Taylor BlauMay 2, 2023
  30. 0/2 pack-bitmap: boundary-based bitmap traversalTaylor Blau, May 5, 2023
  31. 1/2 pack-bitmap.c: extract `fill_in_bitmap()`Taylor Blau, May 5, 2023
  32. 2/2 pack-bitmap.c: use commit boundary during bitmap traversalTaylor Blau, May 5, 2023
  33. Derrick StoleeMay 5, 2023
  34. Taylor BlauMay 5, 2023
  35. Junio C HamanoMay 5, 2023
  36. Derrick StoleeMay 5, 2023
  37. Taylor BlauMay 5, 2023
  38. Derrick StoleeMay 5, 2023
  39. 0/3 pack-bitmap: boundary-based bitmap traversalTaylor Blau, May 8, 2023
  40. 1/3 object: add object_array initializer helper functionTaylor Blau, May 8, 2023
  41. 2/3 pack-bitmap.c: extract `fill_in_bitmap()`Taylor Blau, May 8, 2023
  42. 3/3 pack-bitmap.c: use commit boundary during bitmap traversalTaylor Blau, May 8, 2023
  43. Derrick StoleeMay 8, 2023
  44. Taylor BlauMay 8, 2023
  45. Junio C HamanoMay 10, 2023
  46. Taylor BlauMay 10, 2023
  47. Derrick StoleeMay 11, 2023
  48. 0/3 pack-bitmap: boundary-based bitmap traversalTaylor Blau, Jun 8, 2023
  49. 1/3 object: add object_array initializer helper functionTaylor Blau, Jun 8, 2023
  50. 2/3 pack-bitmap.c: extract `fill_in_bitmap()`Taylor Blau, Jun 8, 2023
  51. 3/3 pack-bitmap.c: use commit boundary during bitmap traversalTaylor Blau, Jun 8, 2023

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.