Subject: Re: Question about your comment on the git parable

From: Jakub Narebski <[email-masked]>
Date: Sun, 26 Feb 2012 15:10:32 +0100

Federico Galassi wrote:
> On 26/feb/2012, at 13:03, Jakub Narebski wrote:
>> Jakub Narebski wrote:

[...]
>>> Note also that the staging area is also a performance hack (perhaps it
>>> began as such; I am not sure about this aspect of git history).  Git uses
>>> it to be able to _cheaply_ check which files were changed.
>> 
>> The first name for staging area, _dircache_, hints at this.
> 
> Unfortunately, i'm not into git development. Do you have a clue on why
> the index, apparently a tree referring to objects, is much faster than
> reading that stuff right from the database?  

The index (at the very beginning "dircache"), or the staging area, stores
more information that are saved in object database, for example stat
information (file metadata).  Most of file metadata is highly local, so
it doesn't make sense to save it in object database of repository, but
it is used to avoid a file read: usually stat-ing a file, which is much
more cheap, is enough to notice that the file did not change.

-- 
Jakub Narebski
Poland