Re: Fix "git commit directory/" performance anomaly
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Aug 10, 2007, 17:14 UTC
- Message-ID
- <alpine.LFD.0.999.0708101008230.30176@woody.linux-foundation.org>
- In-Reply-To
- <alpine.LFD.0.999.0708100924570.30176@woody.linux-foundation.org>
On Fri, 10 Aug 2007, Linus Torvalds wrote:
> > This improves the cold-cache case immensely, since we don't need to bring > in all the file contents, just the index and any files dirty in the index.
The extreme - but not necessarily unusual - case of this is when the index and stat information is hot-cache (which is quite normal, in case you've done a "git diff" or something like that), but the whole source tree is otherwise not. Then the numbers look like this:
Before: [torvalds@woody linux]$ time git commit . real 1m33.751s user 0m3.864s sys 0m2.160s
After: [torvalds@woody linux]$ time git commit . real 0m1.415s user 0m1.176s sys 0m0.260s
The all-hot-cache numbers are better too, of course, just not nearly as noticeable:
Before: [torvalds@woody linux]$ time git commit . real 0m3.960s user 0m3.304s sys 0m0.672s
(and the after case is that 1.415s above, of course, so it's still more than twice as fast - it's just no longer a 60x performance difference!).
(Honesty in advertising: the "after" numbers also contain the "runstatus" speedup, which is the 0.5s -> 0.3s improvement)
Linus