diff mbox series

[v3,1/9] builtin/pack-objects: report reused packfile objects

Message ID 20191115141541.11149-2-chriscool@tuxfamily.org (mailing list archive)
State New, archived
Headers show
Series Rewrite packfile reuse code | expand

Commit Message

Christian Couder Nov. 15, 2019, 2:15 p.m. UTC
From: Jeff King <peff@peff.net>

To see when packfile reuse kicks in or not, it is useful to
show reused packfile objects statistics in the output of
upload-pack.

Helped-by: James Ramsay <james@jramsay.com.au>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 builtin/pack-objects.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Jeff King Dec. 9, 2019, 6:24 a.m. UTC | #1
On Fri, Nov 15, 2019 at 03:15:33PM +0100, Christian Couder wrote:

> From: Jeff King <peff@peff.net>
> 
> To see when packfile reuse kicks in or not, it is useful to
> show reused packfile objects statistics in the output of
> upload-pack.

Yep, I think this one makes sense. I would be a bit curious to see how
often reuse actually kicks in for you with the current code. Back when I
worked on this topic in 2015, it was kicking in for us almost-never (at
least for big repos like torvalds/linux that we were interested in
measuring), but that's because we were packing all of the forks together
(and still do). The earlier heuristics made no sense for that case.

I don't know if it's really worth spending a lot of time trying to
collect data, though.

-Peff
Christian Couder Dec. 11, 2019, 1:48 p.m. UTC | #2
On Mon, Dec 9, 2019 at 7:24 AM Jeff King <peff@peff.net> wrote:
>
> On Fri, Nov 15, 2019 at 03:15:33PM +0100, Christian Couder wrote:
>
> > From: Jeff King <peff@peff.net>
> >
> > To see when packfile reuse kicks in or not, it is useful to
> > show reused packfile objects statistics in the output of
> > upload-pack.
>
> Yep, I think this one makes sense. I would be a bit curious to see how
> often reuse actually kicks in for you with the current code. Back when I
> worked on this topic in 2015, it was kicking in for us almost-never (at
> least for big repos like torvalds/linux that we were interested in
> measuring), but that's because we were packing all of the forks together
> (and still do). The earlier heuristics made no sense for that case.
>
> I don't know if it's really worth spending a lot of time trying to
> collect data, though.

Unfortunately it's not yet easy for me, or people in my team, to
collect data from production servers. I will try to ping people about
that though.
diff mbox series

Patch

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 5876583220..f2c2703090 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3509,7 +3509,9 @@  int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 	if (progress)
 		fprintf_ln(stderr,
 			   _("Total %"PRIu32" (delta %"PRIu32"),"
-			     " reused %"PRIu32" (delta %"PRIu32")"),
-			   written, written_delta, reused, reused_delta);
+			     " reused %"PRIu32" (delta %"PRIu32"),"
+			     " pack-reused %"PRIu32),
+			   written, written_delta, reused, reused_delta,
+			   reuse_packfile_objects);
 	return 0;
 }