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

Re: [PATCH 2/2] builtin/repo: don't fully parse trees

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 16, 2026, 06:39 UTC
Message-ID
<avqlHHo36SDmupF6@pks.im>
In-Reply-To
<CAL71e4PscLozeuQbwNePkgn=QdDPhE1zqTtuGahnKWDN++B0Hw@mail.gmail.com>
On Fri, Nov 13, 2026 at 03:15:16PM +0100, Kristofer Karlsson wrote:
Show 25 quoted lines
> On Fri, 13 Nov 2026 at 14:06, Patrick Steinhardt <ps@pks.im> wrote:
> >
> >   Benchmark 1: ./git repo structure (commit = HEAD~) (10 runs)
> >                   mean     ±       σ          min     …     max
> >     Wall Time    9.635 s   ±   0.072 s      9.534 s   …   9.799 s
> >     Memory         3.4 GiB ±     0.0 GiB      3.4 GiB …     3.4 GiB
> >
> >   Benchmark 2: ./git repo structure (commit = HEAD) (10 runs)
> >                   mean     ±       σ          min     …     max
> >     Wall Time    7.676 s   ±   0.106 s      7.568 s   …   7.823 s            -20.3%
> >     Memory         0.7 GiB ±     0.0 GiB      0.7 GiB …     0.7 GiB          -80.4%  (5.1x less)
> 
> That's quite a nice memory reduction!
> 
> > But besides the speedup, the bigger win here is that we no longer keep
> > these parsed trees in memory at all, which translates in a significant
> > reduction in peak memory usage.
> 
> I took a look at this since it is very similar to what I
> recently did for the incremental connectivity check, where
> the tree verifier also reads raw tree buffers instead of
> going through parse_object_buffer(), for the same memory
> reasons (I only needed to track the oids, not the full objects).
> 
> Both patches look good to me.
Thanks for your review!
Patrick
Previous: Kristofer KarlssonNext: Derrick Stolee
Message 8 of 15 in “builtin/repo: improve counting of objects”
  1. 0/2 builtin/repo: improve counting of objectsPatrick Steinhardt, Nov 13, 2026
  2. 1/2 builtin/repo: only parse objects as neededPatrick Steinhardt, Nov 13, 2026
  3. Kristofer KarlssonNov 13, 2026
  4. Patrick SteinhardtNov 16, 2026
  5. Kristofer KarlssonNov 16, 2026
  6. 2/2 builtin/repo: don't fully parse treesPatrick Steinhardt, Nov 13, 2026
  7. Kristofer KarlssonNov 13, 2026
  8. Patrick SteinhardtNov 16, 2026
  9. Derrick StoleeNov 16, 2026
  10. 0/2 builtin/repo: improve counting of objectsPatrick Steinhardt, Nov 16, 2026
  11. 1/2 builtin/repo: only parse objects as neededPatrick Steinhardt, Nov 16, 2026
  12. 2/2 builtin/repo: don't fully parse treesPatrick Steinhardt, Nov 16, 2026
  13. Kristofer KarlssonNov 16, 2026
  14. Derrick StoleeNov 16, 2026
  15. Junio C HamanoNov 16, 2026

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.