git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-status performance with submodules

From
Jeff King <peff@peff.net>
Date
Dec 2, 2019, 14:05 UTC
Message-ID
<20191202140552.GB16534@sigill.intra.peff.net>
In-Reply-To
<xmqq5zizz0ei.fsf@gitster-ct.c.googlers.com>
On Sun, Dec 01, 2019 at 10:50:29PM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> But the way "git status" code is structured, it probably takes a bit
> of preparatory refactoring.  If I recall correctly, it walks each
> path in the index in the superproject and notes how the file in the
> working tree is different from that of the index and the HEAD, under
> the assumption that inspection of each path is relatively cheap and
> at the same cost.  You'd first need to restructure that part so that
> inspecting groups of index entries can be sharded to separate
> subprocesses while the parent process waits, and have them report to
> the parent process, and let the parent process continue with the
> aggregated result, or something like that.

There's some prior art for this approach in git-checkout, where we have a similar problem with latency of filters (e.g., for LFS). There the individual status for a path becomes a tri-state: success, error, or deferred. And then we collect the results from the deferred ones in a loop.

I think (but didn't look carefully) that this could be slotted into the diff code pretty easily. After the tree-level diff we have a queue of candidates in memory. At that point we should be able to kick off a process in parallel for each submodule, then wait for them all to finish before proceeding. Maybe even as a stage of diffcore_std(), but I'm not sure.

(Hand-wavey, I know, but just trying to point interested folks in the right direction).

-Peff
Previous: Junio C Hamano
Message 3 of 3 in “git-status performance with submodules”
  1. D. Ben KnobleDec 2, 2019
  2. Junio C HamanoDec 2, 2019
  3. Jeff KingDec 2, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.