Re: Change set based shallow clone
- From
- linux@horizon.com <linux@horizon.com>
- Date
- Sep 10, 2006, 19:03 UTC
- Message-ID
- <20060910190332.17667.qmail@science.horizon.com>
- In-Reply-To
- <9e4733910609101100u515ae6e3seababd5780db715d@mail.gmail.com>
> Maybe we are looking at the wrong thing, it may be fast to fork a > process, is it fast for the process to exit?
The lmbench benchmark figures I cited are for fork+exit. The other is fork+exec+exit.
> At the time this was measured parsecvs was executing millions of git > command using system(command). 40% of the CPU was in the kernel, it > stayed that way for hours.
Ah! You are aware, aren't you, that system(string) invokes /bin/sh to parse the string, right? So you're starting bash several million times. ("man system" explains.)
A direct fork() (or even faster, vfork) and exec() is going to have a lot less overhead, although it's more work to code. See Stevens for excellent examples.