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

preload-index: avoid lstat for skip-worktree items #955

Merged

Conversation

jeffhostetler
Copy link

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: Jeff Hostetler jeffhost@microsoft.com

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: Jeff Hostetler <jeffhost@microsoft.com>
@dscho dscho merged commit 395ee78 into git-for-windows:master Nov 15, 2016
@dscho
Copy link
Member

dscho commented Nov 15, 2016

Awesome! Thank you so much!

@jeffhostetler
Copy link
Author

Thanks for the quick turnaround!

dscho pushed a commit that referenced this pull request Nov 16, 2016
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit to git-for-windows/build-extra that referenced this pull request Nov 16, 2016
The preload-index feature [now behaves much better in conjunction with
sparse checkouts](git-for-windows/git#955).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho pushed a commit that referenced this pull request Nov 17, 2016
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho pushed a commit that referenced this pull request Nov 17, 2016
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho pushed a commit that referenced this pull request Nov 18, 2016
…x_perf

preload-index: avoid lstat for skip-worktree items
@dscho dscho added this to the v2.11.0 milestone Nov 18, 2016
dscho added a commit to dscho/git that referenced this pull request Nov 24, 2016
…er/preload_index_perf

preload-index: avoid lstat for skip-worktree items
dscho pushed a commit that referenced this pull request Nov 29, 2016
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit to dscho/git that referenced this pull request Nov 29, 2016
…er/preload_index_perf

preload-index: avoid lstat for skip-worktree items
dscho pushed a commit that referenced this pull request Nov 30, 2016
…x_perf

preload-index: avoid lstat for skip-worktree items
@jeffhostetler jeffhostetler deleted the jeffhostetler/preload_index_perf branch December 1, 2016 19:57
dscho added a commit that referenced this pull request Dec 6, 2016
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Dec 12, 2016
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Jan 11, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Jan 25, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Jan 25, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Jan 25, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Jan 25, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit to dscho/git that referenced this pull request Feb 1, 2017
…er/preload_index_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Feb 2, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
git-for-windows-ci pushed a commit that referenced this pull request Feb 2, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Feb 2, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Feb 2, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
git-for-windows-ci pushed a commit that referenced this pull request Feb 2, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Feb 3, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Feb 4, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Feb 4, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Feb 4, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit to dscho/git that referenced this pull request Feb 4, 2017
…er/preload_index_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit to dscho/git that referenced this pull request Feb 21, 2017
…er/preload_index_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Feb 23, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Feb 25, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Mar 1, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
git-for-windows-ci pushed a commit that referenced this pull request Mar 16, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit to dscho/git that referenced this pull request Mar 20, 2017
…er/preload_index_perf

preload-index: avoid lstat for skip-worktree items
git-for-windows-ci pushed a commit that referenced this pull request Mar 20, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
git-for-windows-ci pushed a commit that referenced this pull request Mar 21, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
git-for-windows-ci pushed a commit that referenced this pull request Mar 24, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Mar 26, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
git-for-windows-ci pushed a commit that referenced this pull request Mar 28, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Apr 12, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
dscho added a commit that referenced this pull request Apr 26, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
git-for-windows-ci pushed a commit that referenced this pull request Apr 26, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
git-for-windows-ci pushed a commit that referenced this pull request May 10, 2017
…x_perf

preload-index: avoid lstat for skip-worktree items
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.

None yet

2 participants