git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/3] avoid quadratic behavior in fetch-pack

From
MFMartin Fick <mfick@codeaurora.org>
Date
Jul 2, 2013, 17:45 UTC
Message-ID
<201307021145.07726.mfick@codeaurora.org>
In-Reply-To
<20130702061149.GB1206@sigill.intra.peff.net>
On Tuesday, July 02, 2013 12:11:49 am Jeff King wrote:
Show 21 quoted lines
> Here are my patches to deal with Martin's pathological
> case, split out for easy reading. I took a few timings
> to show that the results of the 3rd patch are noticeable
> even with 50,000 unique refs (which is still a lot, but
> something that I could conceive of a busy repo
> accumulating over time).
> 
>   [1/3]: fetch-pack: avoid quadratic list insertion in
> mark_complete [2/3]: commit.c: make
> compare_commits_by_commit_date global [3/3]: fetch-pack:
> avoid quadratic behavior in rev_list_push
> 
> And here's the diffstat to prove it is really not scary.
> :)
> 
>  commit.c     |  2 +-
>  commit.h     |  2 ++
>  fetch-pack.c | 16 ++++++++--------
>  3 files changed, 11 insertions(+), 9 deletions(-)
> 
> -Peff

I applied these 3 patches and it indeed improves things dramatically. Thanks Peff, you are awesome!!!

The synthetic test case (but sorted), now comes in at around 15s. The more important real world case (for us), fetching from my production server, which took around 12mins previously, now takes around 30s (I think the extra time is now spent on the Gerrit server, but I will investigate that a bit more)! That is very significant and should make many workflows much more efficient. +1 for merging this. :)

Again, thanks,
-Martin

Note, I tested git-next 1.8.3.2.883.g27cfd27 to be sure that it is still problematic without this patch, it is (running for 10mins now without completing).

-- 
The Qualcomm Innovation Center, Inc. is a member of Code 
Aurora Forum, hosted by The Linux Foundation
 
Previous: Eric SunshineNext: Brandon Casey
Message 12 of 15 in “How to still kill git fetch with too many refs”
  1. Martin FickJul 2, 2013
  2. Jeff KingJul 2, 2013
  3. Jeff KingJul 2, 2013
  4. Jeff KingJul 2, 2013
  5. Junio C HamanoJul 2, 2013
  6. Jeff KingJul 2, 2013
  7. 0/3 avoid quadratic behavior in fetch-packJeff King, Jul 2, 2013
  8. 1/3 fetch-pack: avoid quadratic list insertion in mark_completeJeff King, Jul 2, 2013
  9. 2/3 commit.c: make compare_commits_by_commit_date globalJeff King, Jul 2, 2013
  10. 3/3 fetch-pack: avoid quadratic behavior in rev_list_pushJeff King, Jul 2, 2013
  11. Eric SunshineJul 2, 2013
  12. Martin FickJul 2, 2013
  13. Brandon CaseyJul 2, 2013
  14. Michael HaggertyJul 2, 2013
  15. Martin FickJul 2, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.