Subject: Re: [PATCH 4/9] refs/reftable: don't recompute committer ident

From: Junio C Hamano <[email-masked]>
Date: Wed, 03 Apr 2024 11:58:36 -0700

Patrick Steinhardt <[email-masked]> writes:

> In order to write reflog entries we need to compute the committer's
> identity as it becomes encoded in the log record itself. In the reftable
> backend, computing the identity is repeated for every single reflog
> entry which we are about to write in a transaction. Needless to say,
> this can be quite a waste of effort when writing many refs with reflog
> entries in a single transaction.

It would have been nice to mention which caller benefits from this
rewrite in the above.

There are four callers of the fill_reftable_log_record() function.
The patch moves the split_ident() call from the callee to these four
callers.  The write_transaction_table() function calls it in a loop,
which should give us a big boost.  For other three callers, they
call it at most twice (i.e. write_copy_table() when deleting the old
one), so their contribution to the boost should be minimal.

Makes sense.