You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Having one large, untracked file pegs single CPU core to ~100% #2665
Well, from what I can tell, gitoxide’s status API already has everything we need (I’ve already experimented with it a bit in a small side-project of mine). It’s even being integrated into cargo package as we speak (rust-lang/cargo#15534). To summarize, I’ve just moved it to the front of my oxidize to-do list. 😉
@savchenko I merged #2673 earlier which switches the status tab to use gitoxide instead of libgit2. Would you be able to test the latest master to see whether your issue got fixed?
The CPU usage is following more or less the sinusoidal curve:
Screencast.From.2025-07-29.13-58-57.mp4
The screen recording above is made from this repository with the 1Gb untracked file. I also see the spinner appearing in the top-left corner of the gitui UI.
I was able to reproduce following your instructions (also built from 6685f9a) and then selecting the file in the status view so that gitui started generating the diff.
This produced the following profile that I collected using samply record gitui: https://share.firefox.dev/4kWIQQh. The time is mostly spent in the following function in my case:
let diff = get_diff_raw(&repo, p, stage,false, options)?;
raw_diff_to_file_diff(&diff, work_dir)
}
The first thing I’m going to try is to either convert get_diff to gitoxide or to add logic that avoids generating a diff in the first place for this use case.
The first thing I’m going to try is to either convert get_diff to gitoxide
That would be great.
or to add logic that avoids generating a diff in the first place for this use case.
not sure how you want to avoid generating the diff, as this is whats shown on the right for a file, right? or is this issue about non diff-able binary files?
The first thing I’m going to try is to either convert get_diff to gitoxide
That would be great.
It would also be my preferred solution.
or to add logic that avoids generating a diff in the first place for this use case.
not sure how you want to avoid generating the diff, as this is whats shown on the right for a file, right? or is this issue about non diff-able binary files?
Yes, I was talking about the diff on the right. I would only want to try this if the first option doesn’t work. I was thinking about potentially not running the diff for large binary files or only running a somehow reduced version of the diff.
@savchenko Sorry for the long wait! I was hoping the transition to gitoxide was more easy for that part, but it turns out there’s a few dependencies. Thanks for your suggestion, I’ll have a look at your proposal!
Activity
extrawurst commentedon Jun 10, 2025
Oh boy that sounds like an upstream issue with libgit2 and their slow status functions - @cruessler when can we migrate the status tab to gitoxide? 😉
cruessler commentedon Jun 10, 2025
Well, from what I can tell,
gitoxide’s status API already has everything we need (I’ve already experimented with it a bit in a small side-project of mine). It’s even being integrated intocargo packageas we speak (rust-lang/cargo#15534). To summarize, I’ve just moved it to the front of my oxidize to-do list. 😉cruessler commentedon Jul 28, 2025
@savchenko I merged #2673 earlier which switches the status tab to use
gitoxideinstead oflibgit2. Would you be able to test the latestmasterto see whether your issue got fixed?savchenko commentedon Jul 29, 2025
@cruessler still happens unfortunately.
Steps to reproduce
cargo build --releasefrom 6685f9add if=/dev/urandom of=random_big_file bs=1M count=1000gituiThe CPU usage is following more or less the sinusoidal curve:
Screencast.From.2025-07-29.13-58-57.mp4
The screen recording above is made from this repository with the 1Gb untracked file. I also see the spinner appearing in the top-left corner of the
gituiUI.cruessler commentedon Jul 29, 2025
Thanks for the detailed steps!
I was able to reproduce following your instructions (also built from 6685f9a) and then selecting the file in the status view so that
gituistarted generating the diff.This produced the following profile that I collected using
samply record gitui: https://share.firefox.dev/4kWIQQh. The time is mostly spent in the following function in my case:gitui/asyncgit/src/sync/diff.rs
Lines 204 to 217 in 6685f9a
The first thing I’m going to try is to either convert
get_difftogitoxideor to add logic that avoids generating a diff in the first place for this use case.extrawurst commentedon Jul 29, 2025
That would be great.
not sure how you want to avoid generating the diff, as this is whats shown on the right for a file, right? or is this issue about non diff-able binary files?
cruessler commentedon Jul 29, 2025
It would also be my preferred solution.
Yes, I was talking about the diff on the right. I would only want to try this if the first option doesn’t work. I was thinking about potentially not running the diff for large binary files or only running a somehow reduced version of the diff.
savchenko commentedon Aug 11, 2025
Perhaps, as a temporarily workaround, maximum file size to display can be limited via options?
For example, if
max_size_to_displayis < than file size, then render "File size exceeded" in the "Diff:" section.cruessler commentedon Nov 15, 2025
@savchenko Sorry for the long wait! I was hoping the transition to
gitoxidewas more easy for that part, but it turns out there’s a few dependencies. Thanks for your suggestion, I’ll have a look at your proposal!savchenko commentedon Oct 22, 2026
...fast-forward one year... :-)
@cruessler have you had a chance get some traction on this one?
In my very humble opinion, the CPU stall is one of the more severe issues in
gitui.