Re: [PATCH v2 6/9] index-format: update preamble to cached tree extension
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 7, 2021, 20:12 UTC
- Message-ID
- <xmqqv9c8ld5h.fsf@gitster.c.googlers.com>
- In-Reply-To
- <5a1a51c1-7ada-6f66-a6d0-2fc01303d334@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 8 quoted lines
>> We later found out that we rather often compare the index against >> the tree of HEAD (think: "git status"), and diff-lib.c::diff_cache() >> does take advantage of the fact that an entire directory can be >> skipped if the tree object taken from the HEAD side exactly matches >> the tree recorded for the subdirectory in the cache tree extension. > > I need to read more about this. traverse_by_cache_tree() seems to > be a good place to start. Thanks.
Ah, that one I forgot about.
What I had in mind was a different optimization that is far more aggressive in unpack-trees.c::unpack_callback(); look for a comment that begins with "Everything under the name matches". The block allows us to skip an entire subdirectory hierarchy.