Re: [RFC PATCH 3/3] grep: don't add submodules to the alternates list
- From
- Brandon Williams <bwilliamseng@gmail.com>
- Date
- Sep 21, 2019, 21:58 UTC
- Message-ID
- <CALN-EhSnadjdgdpbuZhj5tDQe5a8uQ6CBnDgh4CZ-AG3JuU_LA@mail.gmail.com>
- In-Reply-To
- <fc5f5fe95c10ac66d1234a025122c8866965021f.1568771073.git.matheus.bernardino@usp.br>
On Tue, Sep 17, 2019 at 6:56 PM Matheus Tavares <matheus.bernardino@usp.br> wrote:
Show 15 quoted lines
> > When grepping with --recurse-submodules, the object directory of the > submodule is added to the in-memory alternates list. This makes git need > to watch out for more packfiles which might bring bad consequences for > memory and performance. > > Now that raw_object_store is a member of the struct repository, it's > possible to use the submodules' instances directly, without the need to > add its odbs to the alternates list. So let's instead pass the subrepo > down to the threads and replace function calls which use > the_repository by default for their more general counterparts. Also, > submodule cleanup must be refactored as calling repo_clear() at the end > of grep_submodules(), might free the subrepo's resources before threads > have finished working on it. To do that, let's keep track of the > workers progress and only call repo_clear() when it's safe to do so.
This is incredibly exciting. Glad to see the effort that were started years ago to finally come to fruition.