Re: remove_duplicates() in builtin/fetch-pack.c is O(N^2)
- From
Jeff King <peff@peff.net>
- Date
- May 22, 2012, 07:37 UTC
- Message-ID
- <20120522073740.GA10093@sigill.intra.peff.net>
- In-Reply-To
- <4FBB3D2B.4010300@alum.mit.edu>
On Tue, May 22, 2012 at 09:15:55AM +0200, Michael Haggerty wrote:
Show 5 quoted lines
> If it is not too much trouble, please let me know where I can obtain > your test repo and what commands you used to get your result. (Was > the local repo already a full clone of the remote, including all 400k > references? How was the remote set up--sharing data or not, local or > remote? Warm or cold disk cache?)
I've put the repo up at:
https://gist.github.com/raw/2767328/603926240fabb4d3e3abc3c93a1913d91852cc7e/rails.tar.gz
You can reproduce the slow-down with:
cd rails.git && git fetch . refs/*:refs/*
which should be a no-op, as we already have all of the refs. I don't know if the problem is actually specific to fetch; that was just how I noticed it.
When I try it with both 'next' and v1.7.10, I see that the latter is much faster. I did my tests with a warm cache, but the interesting number is the CPU time, which is quite different.
-Peff