• Jeff Hostetler's avatar
    preload-index: avoid lstat for skip-worktree items · e596acc2
    Jeff Hostetler authored
    Teach preload-index to avoid lstat() calls for index-entries
    with skip-worktree bit set.  This is a performance optimization.
    
    During a sparse-checkout, the skip-worktree bit is set on items
    that were not populated and therefore are not present in the
    worktree.  The per-thread preload-index loop performs a series
    of tests on each index-entry as it attempts to compare the
    worktree version with the index and mark them up-to-date.
    This patch short-cuts that work.
    
    On a Windows 10 system with a very large repo (450MB index)
    and various levels of sparseness, performance was improved
    in the {preloadindex=true, fscache=false} case by 80% and
    in the {preloadindex=true, fscache=true} case by 20% for various
    commands.
    Signed-off-by: default avatarJeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Johannes Schindelin's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    e596acc2
preload-index.c 2.51 KB