Skip to content
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

Bad scrolling performance in git log buffer #955

Closed
mortezadadgar opened this issue Nov 18, 2023 · 8 comments · Fixed by #959
Closed

Bad scrolling performance in git log buffer #955

mortezadadgar opened this issue Nov 18, 2023 · 8 comments · Fixed by #959
Labels
bug Something isn't working

Comments

@mortezadadgar
Copy link

mortezadadgar commented Nov 18, 2023

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

out_new.mp4

Neovim version

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1697887905

Operating system and version

Gentoo Linux

Steps to reproduce

  1. create a file like https://0x0.st/HvUQ.txt
  2. init git repo and commit
  3. open nvim with minmal config and :Neogit
  4. open git log in neogit
  5. 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",
})
@mortezadadgar mortezadadgar added the bug Something isn't working label Nov 18, 2023
@mortezadadgar mortezadadgar changed the title Bad performance scrolling in git log buffer Bad scrolling performance in git log buffer Nov 18, 2023
@CKolkey
Copy link
Member

CKolkey commented Nov 20, 2023

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.

@CKolkey
Copy link
Member

CKolkey commented Nov 22, 2023

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! #959

So, this won't look nice for the current stable release, but it's a HUGE performance win.

@mortezadadgar
Copy link
Author

Thanks for fixing it can't wait for it to be merged!

@CKolkey
Copy link
Member

CKolkey commented Nov 22, 2023

Same, this has been bugging me for ages.

@mortezadadgar
Copy link
Author

@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

@CKolkey
Copy link
Member

CKolkey commented Dec 3, 2023

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

@mortezadadgar
Copy link
Author

oh sorry I thought that's merged into master branch

@CKolkey
Copy link
Member

CKolkey commented Dec 3, 2023

Ahh, yeah, no, it uses the new native folds, which requires api's that are only on nightly. Eta... march? Not my call :)

@CKolkey CKolkey mentioned this issue Apr 12, 2024
4 tasks
@CKolkey CKolkey closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants