Re: [PATCH] index-pack: avoid excessive re-reading of pack directory
- From
Jeff King <peff@peff.net>
- Date
- Jun 9, 2015, 17:41 UTC
- Message-ID
- <20150609174106.GB32034@peff.net>
- In-Reply-To
- <20150609172436.GA32034@peff.net>
On Tue, Jun 09, 2015 at 01:24:36PM -0400, Jeff King wrote:
Show 9 quoted lines
> I tested this on my system, and confirmed that for a "git clone > --no-local --bare git.git": > > 1. It cuts the number of openat/getdents/close syscalls by several > orders of magnitude. > > 2. The overall time drops from ~11.4s to ~10.5s. I suppose if I timed > only the `index-pack` process, it would be even higher (as a > percentage improvement).
Just for fun, I did a "git pack-objects --all --stdout" from linux.git, and then timed "git index-pack --stdin" on it in an empty repo. With a configured alternate pointing to another empty repo, just to make it more unfair. And then I stored it all on a ramdisk to emphasize the cost of the syscalls versus hitting the disk. The numbers I got were:
[before] real 2m13.093s user 3m31.884s sys 0m55.208s
[after] real 1m40.389s user 3m10.776s sys 0m26.012s
That's sort of a ridiculous test, but it does show that this was having some impact even on "normal" systems without insane syscall latencies.
-Peff