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, 17:08 UTC
Message-ID
<Pine.LNX.4.64.0606120958230.5498@g5.osdl.org>
In-Reply-To
<9e4733910606120944p4deb170ejc2863846685917f6@mail.gmail.com>
On Mon, 12 Jun 2006, Jon Smirl wrote:
> 
> The svn repository was built by cvs2svn, none of the git tools were involved.
Ok, so that part is purely a SVN issue.

Having that many files in a single directory (or two) is a total disaster. That said, it works well enough if you don't create new files very often (and _preferably_ don't look them up either, although that is effectively helped by indexing). I _suspect_ that

 - the "cvs->svn" import process was probably optimized so that it did one 
   file at a time (your "eight stages" description certainly sounds as if 
   it could do it), and in that case it's entirely possible that that can 
   be done efficiently (ie you still do file creates and lookups in an 
   increasingly big directory, but you do it only _once_ per file, rather 
   than look up old files all the time). So your lookup ratio would be 1:1 
   with the files.
   Doing a git-cvsimport would then do basically random lookups in that 
   _huge_ directory, and instead of reading the files one at a time (and 
   fully) and never again, I assume it opens them, reads one revision, 
   closes it, and then goes on to the next revision, so it will have a 
   much higher lookup ratio (you'd look up every file several times).
 - I suspect the SVN people must be hurting for performance themselves. I 
   guess they don't expect to be able to do 5-10 commits per second, the 
   way git was designed to do. So they optimized the cvs import part, but 
   their actual regular live usage is probably hitting this same directory 
   inefficiency.

Of course, the old SVN Berkeley DB usage was probably even worse (not in system time, but I'd expect the access patterns within the BDB file to be pretty nasty, and probably a lot of user time spent seeking around it). But in this particular case, it might even have been better.

Maybe we could teach the SVN people about pack-files? ;)
			Linus
Previous: Jon SmirlNext: Jon Smirl
Message 11 of 14 in “Re: svn to git, N-squared?”
  1. linux@horizon.comJun 12, 2006
  2. Jon SmirlJun 12, 2006
  3. Linus TorvaldsJun 12, 2006
  4. Jon SmirlJun 12, 2006
  5. Linus TorvaldsJun 12, 2006
  6. Jon SmirlJun 12, 2006
  7. Jon SmirlJun 12, 2006
  8. Linus TorvaldsJun 12, 2006
  9. Linus TorvaldsJun 12, 2006
  10. Jon SmirlJun 12, 2006
  11. Linus TorvaldsJun 12, 2006
  12. Jon SmirlJun 12, 2006
  13. Jon SmirlJun 12, 2006
  14. Jon SmirlJun 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.