Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fscache: add not-found directory cache to fscache #994

Merged
merged 2 commits into from
Jan 25, 2017

Commits on Jan 24, 2017

  1. fscache: add key for GIT_TRACE_FSCACHE

    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler committed Jan 24, 2017
    Configuration menu
    Copy the full SHA
    0217bed View commit details
    Browse the repository at this point in the history
  2. fscache: remember not-found directories

    Teach FSCACHE to remember "not found" directories.
    
    This is a performance optimization.
    
    FSCACHE is a performance optimization available for Windows.  It
    intercepts Posix-style lstat() calls into an in-memory directory
    using FindFirst/FindNext.  It improves performance on Windows by
    catching the first lstat() call in a directory, using FindFirst/
    FindNext to read the list of files (and attribute data) for the
    entire directory into the cache, and short-cut subsequent lstat()
    calls in the same directory.  This gives a major performance
    boost on Windows.
    
    However, it does not remember "not found" directories.  When STATUS
    runs and there are missing directories, the lstat() interception
    fails to find the parent directory and simply return ENOENT for the
    file -- it does not remember that the FindFirst on the directory
    failed. Thus subsequent lstat() calls in the same directory, each
    re-attempt the FindFirst.  This completely defeats any performance
    gains.
    
    This can be seen by doing a sparse-checkout on a large repo and
    then doing a read-tree to reset the skip-worktree bits and then
    running status.
    
    This change reduced status times for my very large repo by 60%.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler committed Jan 24, 2017
    Configuration menu
    Copy the full SHA
    8544ec3 View commit details
    Browse the repository at this point in the history