Bad scrolling performance in git log buffer
Description
Hey, It's the first time I'm using this plugin and looks pretty promising, although noticed that scrolling in a new file containing 1K lines of change is so slow
https://github.com/NeogitOrg/neogit/assets/27911493/bc4ebe53-e138-469b-aa1c-52dfcc053faa
Neovim version
NVIM v0.9.4 Build type: Release LuaJIT 2.1.1697887905
Operating system and version
Gentoo Linux
Steps to reproduce
- create a file like https://0x0.st/HvUQ.txt
- init git repo and commit
- open nvim with minmal config and
:Neogit - open git log in neogit
- scroll in buffer and watch neovim struggles to scroll smoothly
Expected behavior
scroll smoothly
Actual behavior
scrolling in git log buffer is choppy and slow
Minimal config
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{ "NeogitOrg/neogit", config = true },
"nvim-lua/plenary.nvim",
})
Yeah. There's some gnarly o(n) logic here. I've been meaning to do something about it, but haven't found the time yet.
Well, it just so happens that nvim 0.10 added an API that will let us do native folding instead of the custom stuff we do now! https://github.com/NeogitOrg/neogit/pull/959
So, this won't look nice for the current stable release, but it's a HUGE performance win.
Thanks for fixing it can't wait for it to be merged!
Same, this has been bugging me for ages.
@CKolkey the slowness is not fixed I believe it has gone even worse you can reproduce it with the file that i have attached in issue
Fix won't be on master until nvim 0.10. For now, you can test it out on the nightly branch (assuming you're on nvim nightly)
I haven't finished punching up the commit view, so can't make any claims about that
oh sorry I thought that's merged into master branch
Ahh, yeah, no, it uses the new native folds, which requires api's that are only on nightly. Eta... march? Not my call :)