You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf: renderer highlights via vim.hl.range are slow on large trees #3381
Renderer:render_hl applies every highlight of every line with vim.hl.range. That function is generic: on each call it switches buffer context with vim._with, calls col('$') twice and calls getregionpos. nvim-tree's ranges are always single-line byte ranges, so none of that work is needed.
Impact
µs per highlight
vim.hl.range
6.1
nvim_buf_set_extmark
0.74
At 16.8k visible lines, render_hl is about 50% of Renderer:draw() (620ms) and about 15% of reload_explorer.
Proposed fix
Call nvim_buf_set_extmark directly with the same ranges and the same priority (vim.hl.priorities.user). The highlights produced are identical. Happy to provide a PR for this ofc.
Environment: macOS, Nvim v0.13.0-dev, LuaJIT 2.1. Test repo: 16.8k files and folders, 3.1k git status entries (modified, untracked, ignored). Measured headless with vim.uv.hrtime() and the LuaJIT profiler (jit.p).
changed the title [-]perf: git rev-parse is spawned for every directory loaded[/-][+]perf: renderer highlights via vim.hl.range are slow on large trees[/+]on Nov 5, 2026
Activity
[-]perf: git rev-parse is spawned for every directory loaded[/-][+]perf: renderer highlights via vim.hl.range are slow on large trees[/+]