Re: [GSoC] Designing a faster index format
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Mar 21, 2012, 11:18 UTC
- Message-ID
- <CACsJy8Aga7OYfAL0X+SyHxaF4gzGs+cvqfX+DZNXCua8c9XMig@mail.gmail.com>
- In-Reply-To
- <CALgYhfPOJpKbM__iU4KvChWeXWyyhWb2ocR-SLvrQQHNw5F5dQ@mail.gmail.com>
On Wed, Mar 21, 2012 at 6:08 PM, Thomas Gummerer <t.gummerer@gmail.com> wrote:
Show 17 quoted lines
>> > However I got one more question, since I'm not yet really familiar with >> > the >> > code and internal structure of git, what exactly does the SHA1 over the >> > index exactly achieve? Is it only for checking if the index is still >> > correct >> > for the next time it is used and has not been changed or is there a more >> > important function of it? >> >> It makes sure the index is not corrupt (by disk faults for example). I >> don't think it is used for anything else. Cheaper checksum can be used >> if good enough for the index. See >> http://thread.gmane.org/gmane.comp.version-control.git/190016 and the >> following reply. > > Ok thanks. I guess that could be another way to speed things up, but for > really big repositories probably it won't be enough and the reduction of the > complexity as described in the proposal is the way to go.
Yeah. A good format should not require checksuming the whole index, if we only need to read/verify a few entries, I think.
> Is the current complexity O(n)?
I think so. Have a look at read-cache.c, read_index_from for reading and write_index for writing, as a starting point.
-- Duy