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

Re: [PATCH 1/8] pack-bitmap: initialize `bitmap_writer_init()` with packing_data

From
Jeff King <peff@peff.net>
Date
Aug 29, 2024, 19:36 UTC
Message-ID
<20240829193659.GB423429@coredump.intra.peff.net>
In-Reply-To
<ZtDFRYQRLQoe+CHS@nand.local>
On Thu, Aug 29, 2024 at 03:00:21PM -0400, Taylor Blau wrote:
Show 15 quoted lines
> > Even the midx code, which is not generating a pack, uses a "fake"
> > packing_data as the way to express that (because inherently the bit
> > ordering is all coming from the pack-index nature). If we likewise ever
> > wrote code to generate bitmaps from an existing pack, it would probably
> > use packing_data, too. :)
> 
> I agree for the most part, though there is a lot of weight in
> packing_data that would be nice to not have to carry around. I know
> within GitHub's infrastructure we sometimes OOM kill invocations of "git
> multi-pack-index write --bitmap" because of the memory overhead (a lot
> of which is dominated by the actual traversal and bitmap generation, but
> a lot that comes from just the per-object overhead).
> 
> I've thought about alternative structures that might be a little more
> memory efficient, but it's never gotten to the top of my list.

True. What the index and bitmap steps really want is not an array of object_entry, but an array of pack_idx_entry (which is the first component of an object_entry).

I wonder how feasible it would be to simply hold two arrays with corresponding entries at each index. Many places only care about one or the other. But for places that do care about both, especially ones that receive a pointer to an individual object_entry, they'd need to receive pointers to both.

I briefly looked at the compile errors that come from making such a change. Many of them look trivial, but I think some of them get weird (the ext_bases array is also holding object_entry structs). So maybe worth pursuing in the long run, but not something to knock out this afternoon.

-Peff
Previous: Taylor BlauNext: Taylor Blau
Message 5 of 20 in “pseudo-merge: avoid empty and non-closed pseudo-merge commits”
  1. 0/8 pseudo-merge: avoid empty and non-closed pseudo-merge commitsTaylor Blau, Aug 15, 2024
  2. 1/8 pack-bitmap: initialize `bitmap_writer_init()` with packing_dataTaylor Blau, Aug 15, 2024
  3. Jeff KingAug 17, 2024
  4. Taylor BlauAug 29, 2024
  5. Jeff KingAug 29, 2024
  6. 2/8 pack-bitmap: drop redundant args from `bitmap_writer_build_type_index()`Taylor Blau, Aug 15, 2024
  7. 3/8 pack-bitmap: drop redundant args from `bitmap_writer_build()`Taylor Blau, Aug 15, 2024
  8. 4/8 pack-bitmap: drop redundant args from `bitmap_writer_finish()`Taylor Blau, Aug 15, 2024
  9. 5/8 pack-bitmap-write.c: select pseudo-merges even for small bitmapsTaylor Blau, Aug 15, 2024
  10. Jeff KingAug 17, 2024
  11. Junio C HamanoAug 17, 2024
  12. Taylor BlauAug 29, 2024
  13. 6/8 t/t5333-pseudo-merge-bitmaps.sh: demonstrate empty pseudo-merge groupsTaylor Blau, Aug 15, 2024
  14. 7/8 pseudo-merge.c: do not generate empty pseudo-merge commitsTaylor Blau, Aug 15, 2024
  15. Jeff KingAug 17, 2024
  16. Taylor BlauAug 29, 2024
  17. 8/8 pseudo-merge.c: ensure pseudo-merge groups are closedTaylor Blau, Aug 15, 2024
  18. Jeff KingAug 17, 2024
  19. Jeff KingAug 17, 2024
  20. Taylor BlauAug 29, 2024

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.