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

Very poor performance after “do not use vim.treesitter.highlighter” #410

Closed
amarshall opened this issue Feb 27, 2024 · 2 comments · Fixed by #414
Closed

Very poor performance after “do not use vim.treesitter.highlighter” #410

amarshall opened this issue Feb 27, 2024 · 2 comments · Fixed by #414
Labels
bug Something isn't working

Comments

@amarshall
Copy link

Description

I am seeing huge performance regressions on some files (usually large ones or those with a lot of nesting) on current master (b8d1ffe). I have bisected this to 4f5c742, before that change (or reverting it) the problem goes away.

Neovim version

v0.9.5

Expected behavior

No lag upon context change or appearance

Actual behavior

Intolerable lag

Minimal config

local plugins = {
  ts         = 'https://github.com/nvim-treesitter/nvim-treesitter',
  ts_context = 'https://github.com/nvim-treesitter/nvim-treesitter-context',
  -- ADD ADDITIONAL PLUGINS THAT ARE _NECESSARY_ TO REPRODUCE THE ISSUE
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.o.runtimepath = install_path..','..vim.o.runtimepath
end

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. nvim --clean -u minimal.lua with some file (I used this file)
  2. :TSContextEnable
  3. Press M to move cursor to the middle (so context appears)
  4. Scroll enough to get some context
  5. Press H to move the cursor to the top (so context disappears)
  6. Press M and experience lag for cursor movement and context reappearing (does not occur with :TSContextDisable)

Also occurs when scrolling through and the context is visible and needs to change.

@amarshall amarshall added the bug Something isn't working label Feb 27, 2024
@colin969
Copy link

colin969 commented Mar 5, 2024

The lag is easily half a second plus for a few thousand line file.

Definitely a deal-breaker, hopefully it'll be a relatively quick fix.

@romgrk
Copy link
Collaborator

romgrk commented Mar 5, 2024

I have reverted the commit for now.

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.

3 participants