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

Re: Question about your comment on the git parable

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 26, 2012, 14:10 UTC
Message-ID
<201202261510.32978.jnareb@gmail.com>
In-Reply-To
<4B4C5353-9820-4068-92DA-50665B1011E1@gmail.com>
Federico Galassi wrote:
> On 26/feb/2012, at 13:03, Jakub Narebski wrote:
>> Jakub Narebski wrote:
[...]
Show 9 quoted lines
>>> 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
Next: Jakub Narebski
Message 1 of 3 in “Re: Question about your comment on the git parable”
  1. Jakub NarebskiFeb 26, 2012
  2. Jakub NarebskiFeb 26, 2012
  3. Neal KreitzingerFeb 28, 2012

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.