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

Use --sparse parameter for ls-files for performance optimization #5187

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

Leo1690
Copy link

@Leo1690 Leo1690 commented Nov 15, 2022

When lfs is used with a huge mono repository with sparse-checkout, the lfs post-commit command took a long time. Per default git ls-files, which excute during the post-commit, retrieves all file paths, irrespectevly of the sparse set. When sparse-index is used ls-files respects the --sparse parameter, which omits the irrelevant files that are not in the sparse set, resulting in a performance improvement.

When lfs is used with a huge mono repository with sparse-checkout,
the lfs post-commit command took a long time. Per default
git ls-files, which excute during the post-commit, retrieves all
file paths, irrespectevly of the sparse set. When sparse-index is
used ls-files respects the --sparse parameter, which omits the
irrelevant files that are not in the sparse set, resulting in a
performance improvement.
@Leo1690 Leo1690 requested a review from a team as a code owner November 15, 2022 11:53
Copy link
Member

@bk2204 bk2204 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the patch, and welcome to Git LFS!

This seems fine to me. I noted the --sparse option lists directories for sparse directories instead of files, but since the only two places we use this function are in locking (where directories cannot be locked) and for finding .gitattributes files, which will never match, I think this is okay here and we shouldn't have any problems.

@bk2204 bk2204 merged commit 941b616 into git-lfs:main Nov 15, 2022
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