-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
current_line_blame
is too CPU intensive
#877
Comments
To solve this we will need to kill unfinished |
@WhyNotHugo can you try #878. It doesn't cancel any processes, but will prevent git blames from running concurrently. |
Given that |
Gitsigns doesn't fetch the blame for the entire file, it does it per line instead. I don't know if doing it for the entire file will be more efficient or not, but I would guess it wouldn't be. |
Description
From what I'm understanding,
current_line_blame
runs an instance of git each time that the cursor moves to another line in order to extract blame information for the new line.This is a problem for large repositories, where a single execution can spike CPU to 100% for a few seconds.
This becomes a terrible problem when scrolling; if I press
j
five times, then 5git
processes are spawned each one taking 100% of a CPU core. If I just holdj
for a short while, this is whattop
looks like:These can take around 20-30s to complete, given that they're all competing for CPU usage.
Neovim version
NVIM v0.9.1
Operating system and version
Linux 6.5.1-0-edge x86_64 Linux
Expected behavior
CPU usage should not spike due to blame calculation
Actual behavior
CPU usage spikes to 100% for each line change on large repositories.
Minimal config
Steps to reproduce
git clone https://gitlab.alpinelinux.org/alpine/aports.git
(or any other large repository)community/xdg-desktop-portal/APKBUILD
)top
in another terminalgit
process that takes a few seconds to exit.Gitsigns debug messages
No response
The text was updated successfully, but these errors were encountered: