Subject: Re: [PATCH 2/5] builtin/repo: collect largest inflated objects

From: Justin Tobler <[email-masked]>
Date: Wed, 18 Feb 2026 14:01:04 -0600

On 26/02/03 02:45PM, Junio C Hamano wrote:
> Justin Tobler <[email-masked]> writes:
> 
> > The "structure" output for git-repo(1) shows the total inflated and disk
> > sizes of reachable objects in the repository, but doesn't show the size
> > of the largest individual objects. Since an individual object may be a
> > large contributor to the overall repository size, it is useful for users
> > to know the maximum size of individual objects.
> 
> Hmph.  It is true that a byte is worth the same amount of money no
> matter what object it is used to represent, but comparing the size
> of a commit object and the size of a blob object feels inherently
> meaningless to me.

I certainly agree that comparing max size values between the types
themselves is not particularly meaningfull. I do think though the max
size values by themselves provide insight into the extremes of the
repository.

> It all depends on what you are trying to learn out of the stats, but
> having many small blob objects that add up to 1GB and having medium
> number of medium sized tree objects that adds up to the same 1GB
> would give the same number in object_stats.inflated_sizes for both
> types, indicating that they are costing you about the same.  But the
> members in largest_objects for these types would be different,
> hinting (incorrectly) that one type may be costing more than the
> other.  Would that really tell us something useful, I have to
> wonder?

Ya the largest objects and inflated sizes you can not really gain any
insight regarding the distribution, but I think it still a good idea to
showcase the extremes. If I see the max size values are "normal", that
at least gives me some insight into the repository usage patterns.

> One thing that is related to "largest" that might be useful is how
> spiky size distribution is.  Among many medium sized blobs, if there
> is only a handful of super huge blobs, that is quite a notable thing
> to know (as opposed to the case where these super huge blobs are
> not so unusual).

I agree that showing a distribution here would be quite useful. This is
something I plan to explore in a followup series. :)

-Justin