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

Re: [PATCH] send-pack.c: add config push.useBitmaps

From
Taylor Blau <me@ttaylorr.com>
Date
Jun 15, 2022, 21:32 UTC
Message-ID
<YqpP0b2zt0sWZD0B@nand.local>
In-Reply-To
<220615.86edzpy9m6.gmgdl@evledraar.gmail.com>
On Wed, Jun 15, 2022 at 09:47:58PM +0200, Ævar Arnfjörð Bjarmason wrote:
> Refresh my memory, we always use them if we find them now, correct?
> I.e. if repack.writebitmaps=true

Kind of. `rev-list` has an opt-in `--use-bitmap-index` option, and `pack-objects` has `pack.useBitmaps` which controls whether or not bitmaps are read.

So `git rev-list --objects HEAD` won't use any bitmaps, even if they exist, but `git rev-list --objects --use-bitmap-index HEAD` will. There there's a good reason not to use bitmaps by default, which is that they (effectively) randomize the ordering of your output.

`pack-objects` behaves slightly differently, cf. its `use_bitmap_index{,default}` variables to see how that works.

Show 6 quoted lines
> This doesn't make it clear: Are we now going to ignore them for "push"
> by default, even if they exist? I.e. a change in the current default.
>
> I think I recall from the previous discussions that it was a bit of hit
> & miss, maybe we're confident that they're almost (or always?) bad for
> "push", but I think there *are* cases where they help.

Yeah. In theory they should help most of the time as long as the bitmaps are kept reasonably up-to-date. There's a tradeoff between using bitmaps and how much walking between bitmap and ref-tips is required. Since every object we encounter between the most recent bitmap and the thing we're trying to generate a bitmap for has to incur extra overhead in order to find and mark its position in the bitmap being generated, there's a certain point at which it would have been faster to just walk down to the roots and avoid bitmaps altogether.

But I suspect that in this case the bitmaps are just simply stale, and that a "git repack -adb" or more aggressive background maintenance would make things quite a bit faster.

Thanks, Taylor

Previous: Ævar Arnfjörð BjarmasonNext: kylezhao (赵柯宇)
Message 5 of 17 in “send-pack.c: add config push.useBitmaps”
  1. send-pack.c: add config push.useBitmapsKyle Zhao via GitGitGadget, Jun 15, 2022
  2. Derrick StoleeJun 15, 2022
  3. Taylor BlauJun 15, 2022
  4. Ævar Arnfjörð BjarmasonJun 15, 2022
  5. Taylor BlauJun 15, 2022
  6. kylezhao (赵柯宇)Jun 16, 2022
  7. send-pack.c: add config push.useBitmapsKyle Zhao via GitGitGadget, Jun 16, 2022
  8. Derrick StoleeJun 16, 2022
  9. Ævar Arnfjörð BjarmasonJun 16, 2022
  10. kylezhao (赵柯宇)Jun 16, 2022
  11. Taylor BlauJun 16, 2022
  12. Junio C HamanoJun 16, 2022
  13. Jeff KingJun 16, 2022
  14. send-pack.c: add config push.useBitmapsKyle Zhao via GitGitGadget, Jun 17, 2022
  15. Junio C HamanoJun 17, 2022
  16. send-pack.c: add config push.useBitmapsKyle Zhao via GitGitGadget, Jun 17, 2022
  17. Junio C HamanoJun 17, 2022

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.