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

dir.c: make add_excludes aware of fscache during status #1344

Merged

Conversation

jeffhostetler
Copy link

Teach read_directory_recursive() and add_excludes() to
be aware of optional fscache and avoid trying to open()
and fstat() non-existant ".gitignore" files in every
directory in the worktree.

The current code in add_excludes() calls open() and then
fstat() for a ".gitignore" file in each directory present
in the worktree. Change that when fscache is enabled to
call lstat() first and if present, call open().

This seems backwards because both lstat needs to do more
work than fstat. But when fscache is enabled, fscache will
already know if the .gitignore file exists and can completely
avoid the IO calls. This works because of the lstat diversion
to mingw_lstat when fscache is enabled.

This reduced status times on a 350K file enlistment of the
Windows repo on a NVMe SSD by 0.25 seconds.

Signed-off-by: Jeff Hostetler jeffhost@microsoft.com

Teach read_directory_recursive() and add_excludes() to
be aware of optional fscache and avoid trying to open()
and fstat() non-existant ".gitignore" files in every
directory in the worktree.

The current code in add_excludes() calls open() and then
fstat() for a ".gitignore" file in each directory present
in the worktree.  Change that when fscache is enabled to
call lstat() first and if present, call open().

This seems backwards because both lstat needs to do more
work than fstat.  But when fscache is enabled, fscache will
already know if the .gitignore file exists and can completely
avoid the IO calls.  This works because of the lstat diversion
to mingw_lstat when fscache is enabled.

This reduced status times on a 350K file enlistment of the
Windows repo on a NVMe SSD by 0.25 seconds.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
@dscho dscho merged commit fe8b815 into git-for-windows:master Nov 1, 2017
@dscho
Copy link
Member

dscho commented Nov 1, 2017

Thank you!

@dscho dscho added this to the v2.15.0(2) milestone Nov 1, 2017
dscho added a commit to git-for-windows/build-extra that referenced this pull request Nov 2, 2017
Operations in massively-sparse worktrees
[are now much faster of `core.fscache =
true`](git-for-windows/git#1344).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Nov 6, 2017
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Nov 7, 2017
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Nov 29, 2017
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Dec 6, 2017
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Jan 2, 2018
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Jan 18, 2018
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Jan 20, 2018
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Jan 22, 2018
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Jan 22, 2018
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Jan 22, 2018
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Feb 16, 2018
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Mar 23, 2018
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Apr 3, 2018
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request May 29, 2018
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request May 29, 2018
…cache

dir.c: make add_excludes aware of fscache during status
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
…xcludes_with_fscache

dir.c: make add_excludes aware of fscache during status
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
…xcludes_with_fscache

dir.c: make add_excludes aware of fscache during status
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
…xcludes_with_fscache

dir.c: make add_excludes aware of fscache during status
@jeffhostetler jeffhostetler deleted the perf_add_excludes_with_fscache branch July 24, 2018 13:34
dscho added a commit that referenced this pull request Aug 22, 2018
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Sep 26, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Sep 26, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Sep 26, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Sep 27, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit to dscho/git that referenced this pull request Oct 3, 2024
…xcludes_with_fscache

dir.c: make add_excludes aware of fscache during status
dscho added a commit to dscho/git that referenced this pull request Oct 4, 2024
…xcludes_with_fscache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 4, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 4, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 4, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit to dscho/git that referenced this pull request Oct 8, 2024
…xcludes_with_fscache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 8, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 8, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 8, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 8, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 9, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 9, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 10, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 10, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 10, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 10, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 10, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 11, 2024
…cache

dir.c: make add_excludes aware of fscache during status
git-for-windows-ci pushed a commit that referenced this pull request Oct 11, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 11, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 11, 2024
…cache

dir.c: make add_excludes aware of fscache during status
dscho added a commit that referenced this pull request Oct 11, 2024
…cache

dir.c: make add_excludes aware of fscache during status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants