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

run-command: output owner picking strategy

From
WDWilliam Duclot <william.duclot@ensimag.grenoble-inp.fr>
Date
May 20, 2016, 13:11 UTC
Message-ID
<401208017.5792558.1463749910970.JavaMail.zimbra@ensimag.grenoble-inp.fr>
In-Reply-To
<906110267.5791524.1463748828183.JavaMail.zimbra@ensimag.grenoble-inp.fr>

Hi, I stumbled upon this piece of code (run-command.c:pp_collect_finish()), picking the owner of the output amongst parallel processes (introduced by Stephan Beller in commit c553c72eed64b5f7316ce227f6d5d783eae6f2ed)

/*
 * Pick next process to output live.
 * NEEDSWORK:
 * For now we pick it randomly by doing a round
 * robin. Later we may want to pick the one with
 * the most output or the longest or shortest
 * running process time.
 */
for (i = 0; i < n; i++)
   if (pp->children[(pp->output_owner + i) % n].state == GIT_CP_WORKING)
      break;
pp->output_owner = (pp->output_owner + i) % n;
Would it be useful to improve this round-robin into something smarter (as stated by the NEEDSWORK)? It seems to be only used for submodules fetch/clone.

The options would be (as said in the comment): 1 - pick the process with the longest running process time 2 - pick the process with the shortest running process time 3 - pick the process for which the output buffer is the longest

But with one of those strategies, wouldn't we lose the advantage of having the same output order as a non-parallelized version? Cf the commit message.
What do you think ? 
Next: Stefan Beller
Message 1 of 5 in “run-command: output owner picking strategy”
  1. William DuclotMay 20, 2016
  2. Stefan BellerMay 20, 2016
  3. William DuclotMay 20, 2016
  4. Stefan BellerMay 20, 2016
  5. Junio C HamanoMay 20, 2016

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.