-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Archived: Performance / Lag issues #549
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I'm experiencing this issue following the latest update. The lag seems more prominent when writing the buffer. Here's my setup: local tree_cb = require("nvim-tree.config").nvim_tree_callback
vim.g.nvim_tree_indent_markers = 1
vim.g.nvim_tree_hide_dotfiles = 0
vim.g.nvim_tree_git_hl = 0
vim.g.nvim_tree_gitignore = 0
vim.g.nvim_tree_root_folder_modifier = ":t"
vim.g.nvim_tree_ignore = { ".git", "node_modules", ".cache" }
vim.g.nvim_tree_show_icons = { git = 0, files = 1, folders = 1 }
vim.g.nvim_tree_icons = {
default = "",
symlink = "",
git = { unstaged = "•", staged = "•", unmerged = "≠", renamed = "•", untracked = "•" },
folder = { default = "+", open = "-", empty = "+", empty_open = "-" },
lsp = { hint = "•", info = "•", warning = "•", error = "•" },
}
require("nvim-tree").setup({
disable_netrw = true,
hijack_netrw = true,
open_on_setup = false,
ignore_ft_on_setup = {},
auto_close = false,
open_on_tab = false,
update_to_buf_dir = {
enable = true,
auto_open = true,
},
hijack_cursor = false,
update_cwd = true,
update_focused_file = {
enable = true,
update_cwd = false,
ignore_list = { ".git", "node_modules", ".cache" },
},
system_open = {
cmd = nil,
args = {},
},
filters = {
dotfiles = false,
custom = {},
},
git = {
enable = false,
},
view = {
width = 35,
height = 35,
side = "left",
auto_resize = false,
mappings = {
custom_only = false,
list = {
{ key = "l", cb = tree_cb("edit") },
{ key = "<C-s>", cb = tree_cb("split") },
{ key = "h", cb = tree_cb("close_node") },
{ key = "!", cb = tree_cb("toggle_ignored") },
{ key = ".", cb = tree_cb("toggle_dotfiles") },
},
},
},
trash = {
cmd = "trash",
require_confirm = true,
},
})
|
@pedropmedina got not lag whatsoever with your config on my machine. update your plugins and fix your config, there are some deprecated variables. |
Hi @kyazdani42, I'm using zsh. I also tried using the default setup, just Here's my nvim version: NVIM v0.5.1
Build type: Release
LuaJIT 2.1.0-beta3 I also tried disabling all plugins, but that did not improve the performance. The issue takes place when I enable nvim-tree. Expanding tree nodes, creating and deleting new files takes ~ 1.5 seconds to 2 seconds. Also writing the current buffer takes a while to finish. No sure what it could be as I haven't changed anything since the last update. Also, which are the deprecated variables you found in my config? |
Why would fish cause this issue? That seems weird. If I set shell as bash in my config, then the terminal inside nvim would also be bash, that would be a dealbreaker for me. |
Nvim-tree is slow to open for a non-git directory with 100000 filesI create 100000 files under a directory
When I open nvim (nvim -u minimal.vim) and run My minimal config:
Can the file loading be made asynchronous like what chadtree does? |
@yifeikong well i'm not sure why, but many fish users have issues with the tree, and i've never been able to reproduce, but setting the shell to bash made the whole thing fast again. So this must be fish related, if someone could've pinpoint the issue i might have fixed it but no one has yet. I use zsh myself and never had an issue of the tree taking more than a few hundred ms to load on big folders. @jdhao I believe asynchronous file loading would just complexify the whole codebase, if i don't use plenary's async library (and i'd like to avoid having dependencies for now). Chadtree is written in python and the whole thing is running on a separate detached process, which does not block neovim. Using lua you get better feedback but when it gets huge tables, it will slow down within the neovim process. I hope i answered this correctly :) maybe some performance testing would be nice in order to avoid regressions, once the codebase is cleaned up. |
Wasn't sure if I should open new issue for that or use this pinned one. Didn't feel like I have enough information to warrant new issue. Anyways, since recent refactors (did not check exactly which commit) nvim-tree's startup time has increased around 2-3 times.
Prior to recent updates it was around low 10's if I remember correctly. I have not more details about it at the moment, just wanted to bring it to your attention. (loved recent activity, plugin works very well now, thank you so much for all your hard work on it!) |
@gegoune i've rescheduled the on_enter because it was conflicting a lot. I also deferred autocmd setup after the on_enter to avoid clashing. Does this fix the performance regression you observed ? |
@kyazdani42, it has, thanks!
|
@alex-courtis apologies for the delay. I've enabled logging and captured logs both with the Also also I ran log with 25ms timeout |
That shows an incorrect cwd which will never work. Bash shows: That is normal, with the correct cwd. Do you run gnome keyring? A quick intersearch revealed https://bbs.archlinux.org/viewtopic.php?id=276606 |
yeah I run gnome-keyring, I wondered if it was the issue which is why I also tried it with a "clean" zshrc which didn't start it. Thanks for the link though I've been meaning to get round to fixing that xD |
OK yeah you were spot on with |
I'm having serious performance issues, but only when navigating up to a large directory. nvim locks up and its memory usage gradually grows larger and larger (>1GB), forcing me to crash it. But if I start nvim in that large directory and launch nvim-tree, it loads them just fine. I don't think it has any thing to do with git, because it wasn't a git directory. Oddly, I can't reproduce it 100% of the time (it's probably happens closer to 80% of the time), but it always happens when I navigate up to the large directory with The directory isn't even that large, only containing around ~200 directories and a few files. Any clues on what is causing this? |
could you enable the logging and see if there is something unexpected happening first ? Without more information it would be quite hard to help you on that matter :) |
I forced nvim to quit after it ate >1GB of RAM and these are the final lines of the log:
It seems that it locks up when it tries to refind the previously selected file after you go up a directory. |
Thanks for reporting; it's very useful to have data from windows users. I assume Idea: exclude these special directiories as per ac90664 @archiif to track this isse properly, please raise a new bug. Having information around version, config etc. is necessary, as we have just cut over to using file system events to enumerate files. When you raise, please collect another log with |
The issue isn't with the 200ms change dir, it's the find_file call that seems to hang. |
I managed to come up with a set of reproducible steps for the bug: #1480 As @kyazdani42 suggested, looping symlinks were the cause. |
Oh wow... good find. |
Performance is stable and problems documented in the README. Please raise a bug report if you encounter any performance issues. |
- See: nvim-tree/nvim-tree.lua#549 (comment) - Added some paths - Added `catppuccin` theme - Added `fzf` separator option
We've seen this before: 20s freeze after first git status on WSL: #1719 Some fixes have been made in that area however some problems still remain. @codeBruyne please:
Unfortunately no nvim-tree developers have access to or expertise with windows: diagnosis and fix will take an extended time. |
Hello all! |
That one is just a regular startup message and does nothing unless the user is calling setup multiple times. Removed 899ed45 |
I've added some more profiling to hopefully narrow down on the issue. Please pull latest 95ed588 and enable profiling |
Here the following logs: [2022-12-16 08:57:24] [watcher] Watcher:new '/home/pierre/.config/nvim' nil [2022-12-16 08:57:24] [watcher] Event:new '/home/pierre/.config/nvim' [2022-12-16 08:57:24] [watcher] Event:start '/home/pierre/.config/nvim' [2022-12-16 08:57:24] [profile] START explore init /home/pierre/.config/nvim [2022-12-16 08:58:24] [watcher] Watcher:new '/home/pierre/.config/nvim/lua' nil [2022-12-16 08:58:24] [watcher] Event:new '/home/pierre/.config/nvim/lua' [2022-12-16 08:58:24] [watcher] Event:start '/home/pierre/.config/nvim/lua' [2022-12-16 08:58:24] [watcher] Watcher:new '/home/pierre/.config/nvim/plugin' nil [2022-12-16 08:58:24] [watcher] Event:new '/home/pierre/.config/nvim/plugin' [2022-12-16 08:58:24] [watcher] Event:start '/home/pierre/.config/nvim/plugin' [2022-12-16 08:58:24] [profile] END explore init /home/pierre/.config/nvim 60178ms [2022-12-16 08:58:24] [profile] END core init /home/pierre/.config/nvim 60179ms [2022-12-16 08:58:24] [profile] START view open [2022-12-16 08:58:24] [profile] END view open 9ms [2022-12-16 08:58:24] [profile] START draw [2022-12-16 08:58:24] [profile] END draw 0ms As you can see, there 60s between I hope this will help |
@pedro2d10 continuing in new bug #1831 |
If you experience performance issues please look at wiki : Troubleshooting and raise a new bug report if you still experience issues. |
Update 20221217
If you experience performance issues please look at wiki : Troubleshooting and raise a new bug report if you still experience issues.
20221108
Hello, please don't make yet another issue or comment an existing issue regarding
huge lag
in nvim-tree.Please see performance-issues in the README.
If your editor start to lag when using nvim-tree, it might be because of several things:
set shell=/bin/bash
in your vim config.git status --porcelain=v1 --ignored=matching -u
and see if it hangs for a while. If it does, try disabling the git integration all by itself:I have to disclaim that the git status handling will never be fast on huge directories (trying to run the command above with GIT_DIR set did take a few 16seconds on my machine).
The data returned is really heavy and slows down the editor just by itself (loaded 40 to 80mb just of git status text, which can represent 300 or more MB of data in ram which slows down the nvim process).
Usually, it works fine on most repositories, but will probably slow down sometimes.
Alternatively, each git process is now discarded after a configured timeout which is
400ms
by default. This is configurable inThank you all for reading this.
The text was updated successfully, but these errors were encountered: