From: William Duclot Date: Fri, 20 May 2016 13:11:50 GMT Subject: run-command: output owner picking strategy 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 ?