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

Re: svn to git, N-squared?

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 12, 2006, 04:02 UTC
Message-ID
<Pine.LNX.4.64.0606112056440.5498@g5.osdl.org>
In-Reply-To
<9e4733910606112039p7aff60c7w7a074d0e35c7b0f@mail.gmail.com>
On Sun, 11 Jun 2006, Jon Smirl wrote:
> 
> I have it stopped and I am running the repack.
> There are 1.27M files in my .git directory

Yeah, that would do it. That's ~5000 files per object directory, so I assume that your directories are 200+kB in size, and for every new object added, you'll basically have to traverse the old directory fully in order to find an empty place for it (and without hashing, you'll traverse it _twice_ - first to look for it, then to look for the empty space).

Btw, after repacking, if it still has lots of lose objects, and you still have several directories that are huge (because there are pending objects for a commit that didn't happen yet when you ^Z'd the svnimport), you'll literally get better performance if you do something like

	for i in ??
	do
		cp -r $i $i.new
		rm -rf $i
		mv $i.new $i
	done

in your .git/objects/ directory (CAREFUL! Any script that does "rm -rf" should be double- and triple-checked for sanity! ;)

That should make sure that you don't still have huge directories.
(And yes, this is a real problem at least with ext3).

The git cvsimporter ends up repacking the archive every thousand commits. That's just a random number, but it's indicative of what we did there to handle large imports. I don't think anybody has done a large import using the git-svnimport before, so you're in new territory which explains some of the teething problems.

		Linus
Previous: Jon SmirlNext: Yakov Lerner
Message 4 of 9 in “svn to git, N-squared?”
  1. Jon SmirlJun 12, 2006
  2. Linus TorvaldsJun 12, 2006
  3. Jon SmirlJun 12, 2006
  4. Linus TorvaldsJun 12, 2006
  5. Yakov LernerJun 12, 2006
  6. Linus TorvaldsJun 12, 2006
  7. Randal L. SchwartzJun 12, 2006
  8. Randal L. SchwartzJun 12, 2006
  9. Eric WongJun 12, 2006

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.