Re: [PATCH 2/5] builtin/repo: collect largest inflated objects
From: Junio C Hamano <hidden>
Date: 2026-02-03 22:45:11
Justin Tobler [off-list ref] 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. 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? 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).