Re: [PATCH 4/9] refs/reftable: don't recompute committer ident
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 3, 2024, 18:58 UTC
- Message-ID
- <xmqqedbm6zoj.fsf@gitster.g>
- In-Reply-To
- <a9a6795c025b23035bfdd3e23b0113df9f6c5e4b.1712078736.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 6 quoted lines
> 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.