-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
I noticed my laptop getting hot when I'm not 'doing' anything and realised lazygit is sitting at 60% CPU usage in the background.
I did a perf top -p <PID>
and noticed it is spending a lot of CPU time rerendering the screen.

I then noticed that in the corner lazygit is displaying the 'Fetching /' spinner, which updates quite quickly.
This repository has SSH remotes that are not always reachable, so the fetching spinner pretty much stays on all the time.
To Reproduce
Steps to reproduce the behaviour:
- Add a git remote that is slow to fetch for some reason (e.g. by being offline, without any appropriate timeout)
- Launch lazygit
- Observe 'Fetching' spinner and high idle CPU usage
Expected behaviour
Not being so CPU intensive for a background task, I guess
Could also consider a config option to disable fetching from non-origin remotes for example.
Workaround
This setting makes the spinner update very slowly which more or less works around the problem:
gui:
spinner:
rate: 5000
(default is 50 ms)
Alternatively, the background fetch mechanism could be disabled in the config.
Screenshots
If applicable, add screenshots to help explain your problem.
Version info:
commit=, build date=, build source=nix, version=0.51.1, os=linux, arch=amd64, git version=2.49.0
git version 2.49.0
Additional context
Add any other context about the problem here.
Note: please try updating to the latest version or manually building the latest master
to see if the issue still occurs.