Derrick Stolee <stolee@xxxxxxxxx> writes: >> 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.