Re: [PATCH 4/9] refs/reftable: don't recompute committer ident
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Apr 4, 2024, 05:36 UTC
- Message-ID
- <Zg48Z-jcJ8YiF04b@tanuki>
- In-Reply-To
- <xmqqedbm6zoj.fsf@gitster.g>
On Wed, Apr 03, 2024 at 11:58:36AM -0700, Junio C Hamano wrote:
Show 20 quoted lines
> Patrick Steinhardt <ps@pks.im> 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.
I do say it by saying "write in a transaction", but I agree that this is not exactly obvious. Will rephrase.
Patrick