diff options
author | Victoria Dye <vdye@github.com> | 2021-11-29 15:52:43 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-29 12:51:26 -0800 |
commit | f2a454e0a5e26c0f7b840970f69d195c37b16565 (patch) | |
tree | c7eaaed27d6fa8a413ef42c7805a28d8fe087a3d /Documentation/.gitattributes | |
parent | reset: make --mixed sparse-aware (diff) | |
download | tgif-f2a454e0a5e26c0f7b840970f69d195c37b16565.tar.xz |
unpack-trees: improve performance of next_cache_entry
To find the first non-unpacked cache entry, `next_cache_entry` iterates
through index, starting at `cache_bottom`. The performance of this in full
indexes is helped by `cache_bottom` advancing with each invocation of
`mark_ce_used` (called by `unpack_index_entry`). However, the presence of
sparse directories can prevent the `cache_bottom` from advancing in a sparse
index case, effectively forcing `next_cache_entry` to search from the
beginning of the index each time it is called.
The `cache_bottom` must be preserved for the sparse index (see 17a1bb570b
(unpack-trees: preserve cache_bottom, 2021-07-14)). Therefore, to retain the
benefit `cache_bottom` provides in non-sparse index cases, a separate `hint`
position indicates the first position `next_cache_entry` should search,
updated each execution with a new position.
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/.gitattributes')
0 files changed, 0 insertions, 0 deletions