"Victoria Dye via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > While investigating ref iteration performance in builtins like > 'for-each-ref' and 'show-ref', I found two small improvement opportunities. > > The first patch tweaks the logic around prefix matching in > 'cache_ref_iterator_advance' so that we correctly skip refs that do not > actually match a given prefix. The unnecessary iteration doesn't seem to be > causing any bugs in the ref iteration commands that I've tested, but it > doesn't hurt to be more precise (and it helps with some other patches I'm > working on ;) ). > > The next three patches update how 'loose_fill_ref_dir' determines the type > of ref cache entry to create (directory or regular). On platforms that > include d_type information in 'struct dirent' (as far as I can tell, all > except NonStop & certain versions of Cygwin), this allows us to skip calling > 'stat'. In ad-hoc testing, this improved performance of 'git for-each-ref' > by about 20%. Yay. That is a very obvious one, once it is pointed out. Thanks for noticing and improving. Looking forward to reading the patches themselves.