From: Patrick Steinhardt <ps@pks.im>
To: friel@openai.com
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH v2] pack-objects: trace pack bytes written
Date: Thu, 20 Aug 2026 07:41:33 +0200 [thread overview]
Message-ID: <aoaTjWMSO8og_iFw@pks.im> (raw)
In-Reply-To: <c6a8cdac36d2202055d637ebcc97e484122cdcd4.1787158152.git.friel@openai.com>
On Wed, Aug 19, 2026 at 04:28:10PM -0700, friel@openai.com wrote:
> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> index 1ec5b6f206..252530172c 100644
> --- a/builtin/pack-objects.c
> +++ b/builtin/pack-objects.c
> @@ -1389,6 +1390,8 @@ static void write_pack_file(void)
> display_progress(progress_state, written);
> }
>
> + bytes_written += hashfile_total(f) +
> + the_repository->hash_algo->rawsz;
> if (pack_to_stdout) {
> /*
> * We never fsync when writing to stdout since we may
I guess the addition here accounts for the trailing hash written by the
hashfile. If so, shouldn't we also use the algortihm that the hashfile
uses in the first place via `f->algop->rawsz`?
> @@ -1510,6 +1513,8 @@ static void write_pack_file(void)
> written, nr_result);
> trace2_data_intmax("pack-objects", the_repository,
> "write_pack_file/wrote", nr_result);
> + trace2_data_intmax("pack-objects", the_repository,
> + "write_pack_file/wrote_bytes", bytes_written);
> }
>
> static int no_try_delta(const char *path)
The "write_pack_file/wrote" event is quite awkwardly named, if you ask
me, as it's not immediately obvious what exactly it's counting, and the
second metric may make this even more confusing. In retrospect it
would've been preferable to call this "wrote_objects" to clarify.
I don't really think we guarantee any kind of stability around those
traces, so we could in theory change it here, too. But I don't feel like
my argument is strong enough to really warrant such a change, so maybe
we should just leave it as-is.
Thanks!
Patrick
next prev parent reply other threads:[~2026-08-20 5:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 23:39 [PATCH] pack-objects: trace pack bytes written friel
2026-08-18 1:08 ` Junio C Hamano
2026-08-19 23:28 ` [PATCH v2] " friel
2026-08-20 5:41 ` Patrick Steinhardt [this message]
2026-08-20 8:21 ` Jeff King
2026-08-20 9:13 ` Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aoaTjWMSO8og_iFw@pks.im \
--to=ps@pks.im \
--cc=friel@openai.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.