From: Dominique Quatravaux Date: Thu, 08 Mar 2012 11:41:57 GMT Subject: Re: [PATCH 1/2] rebase -i: optimize the creation of the todo file Message-ID: In-Reply-To: On Thu, Mar 8, 2012 at 12:36 PM, Dominique Quatravaux wrote: > On Thu, Mar 8, 2012 at 12:20 PM, Johannes Sixt wrote: >> Am 3/8/2012 11:42, schrieb Dominique Quatravaux: >>> +     shortsha1=$(echo $sha1 | cut -c1-7) >> >>> -             sha1=$(git rev-parse $shortsha1) >> >> Why do you call it "optimization" when you spend two or three subprocesses >> instead of one? > > echo is a shell internal. "git rev-parse" is two processes just as > "cut" and a pipe. My mistake, strace git rev-parse revals that this is only one process. Still, I think that saving a bunch of filesystem access beats saving one fork() (one of the two processes in my patched version is a shell, so no execve() there) but I admit I haven't benchmarked this. --   Dominique Quatravaux   +41 79 609 40 72