Re: [RFC \ WISH] Add -o option to git-rev-list
- From
- Marco Costalba <mcostalba@gmail.com>
- Date
- Dec 11, 2006, 17:39 UTC
- Message-ID
- <e5bfff550612110939r58df1a73ud28983633c12e487@mail.gmail.com>
- In-Reply-To
- <Pine.LNX.4.64.0612110905180.12500@woody.osdl.org>
On 12/11/06, Linus Torvalds <torvalds@osdl.org> wrote:
Show 19 quoted lines
> > > On Mon, 11 Dec 2006, Linus Torvalds wrote: > > > > That's not timing what I asked. That's just timing the "git-rev-list". You > > need to time the "cat" part too. Either use a script, or do something like > > > > time sh -c "git-rev-list ... | cat > /dev/null". > > Btw, if you do this, you'll actually see one of the _real_ advantages of > pipes. > > On an SMP system, you'll easily get output like "110%CPU", since now the > git-rev-list and the user can run in parallel. Of course, they can do so > with temp-files too, but then you have all the "is it a true EOF, or is it > just the fact that the writer hasn't written everything yet" problem (and > the _normal_ solution for that is to simply not allow any overlapping > work). >
Sorry for wrong data, I will repost as soon as I can.
Regarding the _normal_ solution we have one more hipotesys to take advantage of: git-rev-list when has nothing more to read..exits.
This is what lead to the exit loop condition based on git-rev-list is still alive, instead of messing with an EOF.
eof = (no more data && !rev_list_is_running);
With this we could enter the loop one more time then necessary, but nothing else bad should happen.