From: Linus Torvalds Date: Mon, 13 Feb 2006 05:05:55 GMT Subject: Re: Handling large files with GIT Message-ID: In-Reply-To: On Sun, 12 Feb 2006, Linus Torvalds wrote: > > This is a large part of why git performs well on the kernel. Most merges > don't actually touch all - or even a very big percentage - of the over > thousand subdirectories in the kernel. Git can quickly see and ignore the > whole subdirectory when that happens - the SHA1 is exactly the same, so > git knows that every file under that subdirectory (and every recursive > directory) is the same. Final note: this means, for example, that git is relatively bad at tracking a "hashed" nested file directory (like the one git itself uses), because new files will end up randomly appearing in every directory, and no directory is ever "stable". In contrast, if the directory structure is - for example - something where you index files by date, and subdirectories with older dates are thus much more naturally likely to be quiescent, the "this tree is the same" optimizations work very well. Basically, a lot of the git speed optimizations depend on "on average, things stay the same". We may have 18,000+ files in the kernel, but most patches will change maybe five of them. There's a lot of fairly static content and the changes have a certain level of "locality". It's normally a hundred-line patch to one file, not a hundred files that had one-liners. And when 20 files are changed, most of them tend to be in the same subdirectory, etc etc. Taking advantage of those kinds of things is what makes git good at handling software projects. But it wouldn't necessarily be how you lay out a mail directory, for example. An automated file store might want to spread out the changes on purpose. Linus