Content-Length: 236175 | pFad | http://redirect.github.com/go-git/go-git/pull/1379

14 Improve Status performance with many ignored files by silkeh · Pull Request #1379 · go-git/go-git · GitHub
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

Improve Status performance with many ignored files #1379

Open
wants to merge 2 commits into
base: v6-exp
Choose a base branch
from

Conversation

silkeh
Copy link

@silkeh silkeh commented Jan 14, 2025

This PR contains two changes that significantly improve the performance of WorkTree.Status() (from 491 s to 5 s):

  • Skip ignored files when walking through the worktree.
    This signigifantly improves the performance of Status():
    In a repository with 3M ignored files Status now takes 5 s instead of 160 s.
  • Fix loading of .gitignore files in nested ignored directories.
    These were not matched in the current implementation, as that only checks the ignores of the current directory.
    As a side-effect this change also leads to significantly improved performance: in a repository with 3M ignored files Status now takes 160 s instead of 491 s.

I have a backport to master ready if desired.

Fix loading of `.gitignore` files in nested ignored directories.
These were not matched in the current implementation,
as that only checks the ignores of the current directory.

As a side-effect this change also leads to significantly improved performance:
in a repository with 3M ignored files `Status` now takes 160 s instead of 491 s.
Skip ignored files when walking through the worktree.

This signigifantly improves the performance of `Status()`:
In a repository with 3M ignored files `Status` now takes 5 s instead of 160 s.
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.

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://redirect.github.com/go-git/go-git/pull/1379

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy