-
-
Notifications
You must be signed in to change notification settings - Fork 236
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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 5 git
processes are spawned each one taking 100% of a CPU core. If I just hold j
for a short while, this is what top
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
for name, url in pairs{
gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
-- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} do
local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
end
vim.opt.runtimepath:append(install_path)
end
require("gitsigns").setup({
current_line_blame = true,
current_line_blame_opts = {
delay = 0,
},
})
Steps to reproduce
git clone https://gitlab.alpinelinux.org/alpine/aports.git
(or any other large repository)- Open any file in the repository (e.g.:
community/xdg-desktop-portal/APKBUILD
) - CPU will now spike once.
- Open
top
in another terminal - Press j or k in neovim. Note how each keypress spawns a
git
process that takes a few seconds to exit.
Gitsigns debug messages
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working