-
-
Notifications
You must be signed in to change notification settings - Fork 680
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
gitui can take 5+ minutes to load the status view on very large repositories, while git status and gix status complete in ~2 seconds.
To Reproduce
Steps to reproduce the behavior:
- Open gitui in a very large repository
- Navigate to the Status tab
- Observe the endless loading spinner
Expected behavior
Status should load in a few seconds, similar to git status or gix status.
Environment
- gitui version: 0.27/0.28
- OS: Rocky Linux 8.6
- Rust version: 1.94.0-nightly (also tested on stable 1.92.0)
- Repository size: 1.7M files (uses
git-lfs)
Additional context
Profiling revealed that the git index was being loaded 30+ times during startup.
I believe this is caused by asyncgit's StatusParams including a millisecond timestamp (tick) in its hash:
// asyncgit/src/status.rs
pub struct StatusParams {
tick: u128, // milliseconds since epoch
status_type: StatusType,
config: Option<ShowUntrackedFilesConfig>,
}
The tick field was intended to force periodic re-fetches to detect external file changes.
However, because it changes every millisecond, the cache hash changes on every UI tick (every 5 seconds by default), causing a deadly cycle:
- Cache miss => start new fetch
- While fetch is pending, more ticks occur
- Each tick after fetch completes triggers another cache miss
- Result: dozens of index loads, each taking ~15 seconds on my target repo
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working