perf: prevent repeated status fetches in large repos#2824
Open
DannyStoll1 wants to merge 1 commit intogitui-org:masterfrom
Open
perf: prevent repeated status fetches in large repos#2824DannyStoll1 wants to merge 1 commit intogitui-org:masterfrom
DannyStoll1 wants to merge 1 commit intogitui-org:masterfrom
Conversation
Replace time-based cache invalidation with a generation counter. The old `StatusParams` included a millisecond timestamp (tick) in its hash, causing the cache to invalidate on every UI tick. For large repos with millions of files, this led to repeated index loading and 5+ minute load times. This change uses a different strategy to manage cache invalidation: - Remove tick from StatusParams hash - Add generation counter that increments after each fetch completes - Include generation in cache hash This ensures: - No repeated fetches while one is already pending, making gitui usable in large repos - New fetch starts immediately after completion, keeping gitui responsive in small repos - External file changes will still be detected on the next fetch cycle
Collaborator
|
Oh wow interesting, I wonder when we broke that. Great find |
Collaborator
|
Thanks for the PR (and the accompanying issue)! I’ll try to have a look over the weekend! |
Collaborator
|
@DannyStoll1 From what I can tell, these lines seem to serve the same purpose: Lines 95 to 98 in 7747d82 Am I missing something? Do you happen to know why they haven’t prevented |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes/closes #2823
It changes the following:
This ensures:
I followed the checklist:
make checkwithout errors