Skip to content

Conversation

@silkeh
Copy link
Member

@silkeh silkeh commented Jan 13, 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.

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.
@silkeh silkeh force-pushed the improve-ignored-status-performance branch from 999abb5 to dce32ef Compare January 13, 2025 15:34
@silkeh
Copy link
Member Author

silkeh commented Jan 13, 2025

Note to the reviewer: Please close this PR instead of merging it. I'll send it upstream afterwards.

@silkeh silkeh force-pushed the improve-ignored-status-performance branch from dce32ef to 841ef77 Compare January 13, 2025 17:01
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.
@silkeh silkeh force-pushed the improve-ignored-status-performance branch from 841ef77 to 25c3930 Compare January 13, 2025 17:07
@silkeh silkeh closed this Jan 14, 2025
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.

3 participants