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

Re: Really slow 'git gc'

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 19, 2009, 21:14 UTC
Message-ID
<7vr61uku2f.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.00.0902191200010.21686@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 6 quoted lines
> The real reason _seems_ to be the "--unpacked=pack-....pack" arguments. I 
> literally had 232 pack-files, and it looks like a lot of the time was 
> spent in that silly loop oer 'ignore_packed' in find_pack_entry(), when 
> revision.c does that "has_sha1_pack()" thing. You get a O(n**2) effect in 
> number of pack-files: for each commit we look over every pack-file, and 
> for every pack-file we look at, we look over each ignore_pack entry.

I think we can add a single bit to "struct packed_git" and in the middle of setup_revisions() perform the O(N**2) once, so that find_pack_entry() can check the bit without looping.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 4 in “Really slow 'git gc'”
  1. Linus TorvaldsFeb 19, 2009
  2. Junio C HamanoFeb 19, 2009
  3. Linus TorvaldsFeb 19, 2009
  4. Junio C HamanoFeb 19, 2009

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.