On Wed, Mar 12, 2025 at 09:06:08PM +0800, shejialuo wrote: > On Thu, Mar 06, 2025 at 04:08:38PM +0100, Patrick Steinhardt wrote: > > The "files" backend explicitly carves out special logic for its initial > > transaction so that it can avoid writing out every single reference as > > a loose reference. While the assumption is that there shouldn't be any > > preexisting references, we still have to verify that none of the newly > > written references will conflict with any other new reference in the > > same transaction. > > > > Refactor the initial transaction to use batched refname availability > > checks. This does not yet have an effect on performance as we still call > > `refs_verify_refname_available()` in a loop. But this will change in > > subsequent commits and then impact performance when cloning a repository > > with many references or when migrating references to the "files" format. > > > > This will improve performance when cloning a repository with many > > references or when migrating references from any format to the "files" > > format once the availability checks have learned to optimize checks for > > many references in a subsequent commit. > > I guess you forgot to delete some sentences for the commit message. This > paragraph is a little redundant. In the second paragraph, I think we > have already talked about this. Not quite: the second paragraph talks about how this does not yet have an effect, but will have an effect once we have optimized this. The third paragraph on the other hand talks about which specific parts will benefit from the optimizations. Patrick