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

[RFC PATCHv1 0/2] Parallel git submodule fetching

From
Stefan Beller <sbeller@google.com>
Date
Sep 11, 2015, 23:09 UTC
Message-ID
<1442012994-20374-1-git-send-email-sbeller@google.com>

This is a new approach to making git submodules faster without using threads. We'll directly run commands in parallel without an intermediate thread pool.

patch 1 is fixing an error, which was hard to come by in a parallel world, but is not much of a problem in a single-childed world.

The second patch works fine, (I'd love to hear feedback on the percieved change of output) though it has still two edges I want to tackle:

* The fcntl call to make the pipes nonblocking is not checked for errors.
* We also need to communicate back if one process cannot spawn or such,
  i.e. the reporting for all subprocesses combined needs to added. I think
  about adding another callback which is called to finish up a child process.

Earlier attempts used a threading pool, which made the conversion very easy as you don't need to touch lots of existing code as you would just replace the run_command(..) call by an add_task(..). The threading pool would abstract away the whole parallelism and its problems. It would also have the backpressure to the main program, add_task would just not return if there was no place left in the queue.

[1] http://www.spinics.net/lists/git/msg258435.html

Any feedback welcome! Thanks, Stefan

Jonathan Nieder (1):
  Sending "Fetching submodule <foo>" output to stderr
Stefan Beller (1):
  fetch: fetch submodules in parallel
 Documentation/fetch-options.txt |   7 ++
 builtin/fetch.c                 |   6 +-
 builtin/pull.c                  |   6 ++
 run-command.c                   | 144 ++++++++++++++++++++++++++++++++++++++++
 run-command.h                   |  29 ++++++++
 strbuf.c                        |  31 +++++++++
 strbuf.h                        |   1 +
 submodule.c                     |  99 +++++++++++++++++----------
 submodule.h                     |   2 +-
 t/t0061-run-command.sh          |  16 +++++
 t/t5526-fetch-submodules.sh     |  70 ++++++++++++-------
 test-run-command.c              |  23 +++++++
 12 files changed, 373 insertions(+), 61 deletions(-)
-- 
2.6.0.rc0.131.gf624c3d
Next: Stefan Beller
Message 1 of 13 in “[RFC PATCHv1 0/2] Parallel git submodule fetching”
  1. Stefan BellerSep 11, 2015
  2. 1/2 Sending "Fetching submodule <foo>" output to stderrStefan Beller, Sep 11, 2015
  3. 2/2 fetch: fetch submodules in parallelStefan Beller, Sep 11, 2015
  4. Junio C HamanoSep 12, 2015
  5. Stefan BellerSep 14, 2015
  6. Jeff KingSep 14, 2015
  7. Stefan BellerSep 14, 2015
  8. Jonathan NiederSep 14, 2015
  9. Jeff KingSep 14, 2015
  10. [PATCHv2] fetch submodules in parallelStefan Beller, Sep 14, 2015
  11. [PATCHv2] fetch: fetch submodules in parallelStefan Beller, Sep 14, 2015
  12. Junio C HamanoSep 14, 2015
  13. Junio C HamanoSep 14, 2015

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.